Esempio n. 1
0
 @Override
 public Iterable<Vertex> getVertices() {
   if (!addedRelations.isEmpty()) {
     // There are possible new vertices
     List<Vertex> newVs = new ArrayList<Vertex>();
     for (InternalVertex v : vertexCache.getAll()) {
       if (v.isNew() && !(v instanceof TitanType)) newVs.add(v);
     }
     return Iterables.concat(newVs, new VertexIterable(graph, this));
   } else {
     return (Iterable) new VertexIterable(graph, this);
   }
 }
Esempio n. 2
0
 private RelOptTableImpl getTableFrom(List<String> names, List<String> schemaNames) {
   OptiqSchema schema = getSchema(Iterables.concat(schemaNames, Util.skipLast(names)));
   if (schema == null) {
     return null;
   }
   final String name = Util.last(names);
   Pair<String, Table> pair = schema.getTable(name, caseSensitive);
   if (pair == null) {
     pair = schema.getTableBasedOnNullaryFunction(name, caseSensitive);
   }
   if (pair != null) {
     final Table table = pair.getValue();
     final String name2 = pair.getKey();
     return RelOptTableImpl.create(this, table.getRowType(typeFactory), schema.add(name2, table));
   }
   return null;
 }
Esempio n. 3
0
 private Collection<Function> getFunctionsFrom(List<String> names) {
   final List<Function> functions2 = Lists.newArrayList();
   final List<? extends List<String>> schemaNameList;
   if (names.size() > 1) {
     // If name is qualified, ignore path.
     schemaNameList = ImmutableList.of(ImmutableList.<String>of());
   } else {
     OptiqSchema schema = getSchema(defaultSchema);
     if (schema == null) {
       schemaNameList = ImmutableList.of();
     } else {
       schemaNameList = schema.getPath();
     }
   }
   for (List<String> schemaNames : schemaNameList) {
     OptiqSchema schema = getSchema(Iterables.concat(schemaNames, Util.skipLast(names)));
     if (schema != null) {
       final String name = Util.last(names);
       functions2.addAll(schema.getFunctions(name, true));
     }
   }
   return functions2;
 }
 /** @deprecated retained for benefit of old tests */
 public Collection<InetAddress> getWriteEndpoints(
     Token token, String keyspaceName, Collection<InetAddress> naturalEndpoints) {
   return ImmutableList.copyOf(
       Iterables.concat(naturalEndpoints, pendingEndpointsFor(token, keyspaceName)));
 }