@Override public VertexLabelBuilder idStrategy(IdStrategy idStrategy) { E.checkArgument(this.idStrategy == IdStrategy.DEFAULT || this.idStrategy == idStrategy, "Not allowed to change id strategy for " + "vertex label '%s'", this.name); this.idStrategy = idStrategy; return this; }
public String page() { if (this.page != null) { E.checkState(this.limit != Query.NO_LIMIT, "Must set limit when using paging"); E.checkState(this.limit != 0L, "Can't set limit=0 when using paging"); E.checkState(this.offset == 0L, "Can't set offset when using paging, but got '%s'", this.offset); } return this.page; }
public UserpropRelation(Id key, RelationType op, Object value) { E.checkNotNull(op, "relation type"); this.key = key; this.relation = op; this.value = value; }
@Override public void checkCreate(boolean isBatch) { E.checkArgumentNotNull(this.name, "The name of property key can't be null"); E.checkArgument(this.properties == null || this.properties.length == 0, "Not allowed to pass properties when " + "creating property key since it doesn't " + "support meta properties currently"); }
private byte[] column(HugeKeys key) { BackendColumn column = this.entry.column(formatColumnName(key)); E.checkState(column != null, "Not found key '%s' from entry %s", key, this.entry); E.checkNotNull(column.value, "column.value"); return column.value; }
public HugeEdge(final HugeGraph graph, Id id, EdgeLabel label) { super(graph, id); E.checkArgumentNotNull(label, "Edge label can't be null"); this.label = label; this.name = null; this.ownerVertex = null; this.sourceVertex = null; this.targetVertex = null; }
@Override public BackendStore loadSchemaStore(String name) { LOG.debug("ScyllaDBStoreProvider load SchemaStore '{}'", name); if (!this.stores.containsKey(name)) { BackendStore s = new ScyllaDBSchemaStore(this, keyspace(), name); this.stores.putIfAbsent(name, s); } BackendStore store = this.stores.get(name); E.checkNotNull(store, "store"); E.checkState(store instanceof ScyllaDBSchemaStore, "SchemaStore must be an instance of ScyllaDBSchemaStore"); return store; }
@Override public void checkCreate(boolean isBatch) { E.checkArgumentNotNull(this.gremlin, "The gremlin parameter can't be null"); E.checkArgumentNotNull(this.language, "The language parameter can't be null"); E.checkArgument(this.aliases == null || this.aliases.isEmpty(), "There is no need to pass gremlin aliases"); }
public Node(Id id, Node parent) { E.checkArgumentNotNull(id, "Id of Node can't be null"); this.id = id; this.parent = parent; }
@Override public GraphManager provide() { E.checkState(this.manager != null, "Please wait for the server to initialize"); return this.manager; }
@Override public VertexLabelBuilder useAutomaticId() { E.checkArgument(this.idStrategy == IdStrategy.DEFAULT || this.idStrategy == IdStrategy.AUTOMATIC, "Not allowed to change id strategy for " + "vertex label '%s'", this.name); this.idStrategy = IdStrategy.AUTOMATIC; return this; }
public SyspropRelation(HugeKeys key, RelationType op, Object value) { E.checkNotNull(op, "relation type"); this.key = key; this.relation = op; this.value = value; }
@Override public BackendStore loadGraphStore(String name) { LOG.debug("ScyllaDBStoreProvider load GraphStore '{}'", name); if (!this.stores.containsKey(name)) { BackendStore s = new ScyllaDBGraphStore(this, keyspace(), name); this.stores.putIfAbsent(name, s); } BackendStore store = this.stores.get(name); E.checkNotNull(store, "store"); E.checkState(store instanceof ScyllaDBGraphStore, "GraphStore must be an instance of ScyllaDBGraphStore"); return store; }
public <V> Future<?> restore(HugeTask<V> task) { E.checkArgumentNotNull(task, "Task can't be null"); E.checkArgument(!task.isDone(), "No need to restore task '%s', it has been completed", task.id()); task.status(TaskStatus.RESTORING); return this.submitTask(task); }
public IdPrefixQuery(HugeType resultType, Query originQuery, Id start, boolean inclusive, Id prefix) { super(resultType, originQuery); E.checkArgumentNotNull(start, "The start parameter can't be null"); this.start = start; this.inclusiveStart = inclusive; this.prefix = prefix; }
public final synchronized Cluster cluster() { E.checkState(this.cluster != null, "Cassandra cluster has not been initialized"); return this.cluster; }
@Override public VertexLabelBuilder useCustomizeStringId() { E.checkArgument(this.idStrategy == IdStrategy.DEFAULT || this.idStrategy == IdStrategy.CUSTOMIZE_STRING, "Not allowed to change id strategy for " + "vertex label '%s'", this.name); this.idStrategy = IdStrategy.CUSTOMIZE_STRING; return this; }
public PageState(byte[] position, int offset) { E.checkNotNull(position, "position"); this.position = position; this.offset = offset; }
public IdRangeQuery(HugeType resultType, Query originQuery, Id start, boolean inclusiveStart, Id end, boolean inclusiveEnd) { super(resultType, originQuery); E.checkArgumentNotNull(start, "The start parameter can't be null"); this.start = start; this.end = end; this.inclusiveStart = inclusiveStart; this.inclusiveEnd = inclusiveEnd; }
private void checkResultsSize(Object results) { int size = 0; if (results instanceof Collection) { size = ((Collection<?>) results).size(); } E.checkState(size <= TASK_RESULTS_MAX_SIZE, "Job results size %s has exceeded the max limit %s", size, TASK_RESULTS_MAX_SIZE); }