示例#1
0
 @Override
 public TitanType getType(String name) {
   verifyOpen();
   TitanType type = typeCache.get(name);
   if (type == null)
     type = (TitanType) Iterables.getOnlyElement(getVertices(SystemKey.TypeName, name), null);
   return type;
 }
示例#2
0
 @Override
 public TitanVertex getVertex(TitanKey key, Object attribute) {
   Preconditions.checkArgument(
       key.isUnique(Direction.IN), "Key is not uniquely associated to value [%s]", key.getName());
   return Iterables.getOnlyElement(getVertices(key, attribute), null);
 }