• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Index类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.tinkerpop.blueprints.Index的典型用法代码示例。如果您正苦于以下问题:Java Index类的具体用法?Java Index怎么用?Java Index使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Index类属于com.tinkerpop.blueprints包,在下文中一共展示了Index类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public static void main(String[] args) {
	if (args.length != 1) {
		System.err.println("Please enter a graph name.");
		System.err.println("graphs: memory-beta, simpsons, wookieepedia");
		System.err
				.println("Graph path should be set in the graphs.poperties file.");
		System.exit(1);
	}
	

	TinkerGraph graph;
	try {
		graph = SingletonGraph.getInstance().getGraphs().get(args[0]);
		
		Index<Vertex> index = graph.getIndex("verb-idx", Vertex.class);
		GremlinPipeline<Iterable<Vertex>, Vertex> pipeline = new GremlinPipeline<Iterable<Vertex>, Vertex>();

		pipeline.start(index.get("verbIndex", null)).hasNot(NerdleGraphTransformer.PROPERTY_ISSYNONYM, true);
	} catch (ConfigurationException e) {
		e.printStackTrace();
	}
}
 
开发者ID:impro3-nerdle,项目名称:nerdle,代码行数:23,代码来源:GraphFactsCounter.java


示例2: createIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public <T extends Element> Index<T> createIndex(String indexName,
    Class<T> indexClass, Parameter... indexParameters) {
  if (indexClass == null) {
    throw ExceptionFactory.classForElementCannotBeNull();
  }
  else if (globals.getConfig().getIndexableGraphDisabled()) {
    throw new UnsupportedOperationException("IndexableGraph is disabled via the configuration");
  }

  for (Index<?> index : globals.getIndexMetadataWrapper().getIndices()) {
    if (index.getIndexName().equals(indexName)) {
      throw ExceptionFactory.indexAlreadyExists(indexName);
    }
  }

  return globals.getIndexMetadataWrapper().createIndex(indexName, indexClass);
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:20,代码来源:AccumuloGraph.java


示例3: dropIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@Override
public void dropIndex(String indexName) {
  if (globals.getConfig().getIndexableGraphDisabled())
    throw new UnsupportedOperationException("IndexableGraph is disabled via the configuration");

  for (Index<? extends Element> index : getIndices()) {
    if (index.getIndexName().equals(indexName)) {
      globals.getIndexMetadataWrapper().clearIndexNameEntry(indexName, index.getIndexClass());

      try {
        globals.getConfig().getConnector().tableOperations().delete(globals.getConfig()
            .getNamedIndexTableName(indexName));
      } catch (Exception e) {
        throw new AccumuloGraphException(e);
      }

      return;
    }
  }

  throw new AccumuloGraphException("Index does not exist: "+indexName);
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:23,代码来源:AccumuloGraph.java


示例4: getIndices

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@SuppressWarnings({"rawtypes", "unchecked"})
public Iterable<Index<? extends Element>> getIndices() {
  List<Index<? extends Element>> indexes = new ArrayList<Index<? extends Element>>();

  IndexedItemsListParser parser = new IndexedItemsListParser();

  Scanner scan = null;
  try {
    scan = getScanner();
    scan.fetchColumnFamily(new Text(IndexMetadataEntryType.__INDEX_NAME__.name()));

    for (IndexedItem item : parser.parse(scan)) {
      indexes.add(new AccumuloIndex(globals,
          item.getKey(), item.getElementClass()));
    }

    return indexes;

  } finally {
    if (scan != null) {
      scan.close();
    }
  }
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:25,代码来源:IndexMetadataTableWrapper.java


示例5: iterator

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public Iterator<Index<T>> iterator() {
    return new Iterator<Index<T>>() {
        private final Iterator<Index<T>> itty = iterable.iterator();

        public void remove() {
            this.itty.remove();
        }

        public Index<T> next() {
            return new com.tinkerpop.blueprints.util.wrappers.event2.EventIndex<T>(this.itty.next(), eventGraph);
        }

        public boolean hasNext() {
            return itty.hasNext();
        }
    };
}
 
开发者ID:dsiegel,项目名称:BlueprintsExperiment,代码行数:18,代码来源:EventIndexIterable.java


示例6: iterator

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@Override
public Iterator<Index<T>> iterator() {
    return new Iterator<Index<T>>() {
        private final Iterator<Index<T>> itty = iterable.iterator();

        @Override
        public void remove() {
            this.itty.remove();
        }

        @Override
        public Index<T> next() {
            return new ActiveVersionedIndex<T, V>(this.itty.next(), graph);
        }

        @Override
        public boolean hasNext() {
            return itty.hasNext();
        }
    };
}
 
开发者ID:indexiatech,项目名称:antiquity,代码行数:22,代码来源:ActiveVersionedIndexIterable.java


示例7: iterator

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public Iterator<Index<T>> iterator() {
    return new Iterator<Index<T>>() {
        private final Iterator<Index<T>> itty = iterable.iterator();

        public void remove() {
            throw new UnsupportedOperationException(ReadOnlyTokens.MUTATE_ERROR_MESSAGE);
        }

        public Index<T> next() {
            return new ReadOnlyIndex<T>(this.itty.next());
        }

        public boolean hasNext() {
            return this.itty.hasNext();
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:18,代码来源:ReadOnlyIndexIterable.java


示例8: iterator

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public Iterator<Index<T>> iterator() {
    return new Iterator<Index<T>>() {
        private final Iterator<Index<T>> itty = iterable.iterator();

        public void remove() {
            this.itty.remove();
        }

        public boolean hasNext() {
            return this.itty.hasNext();
        }

        public Index<T> next() {
            return new PartitionIndex<T>(this.itty.next(), graph);
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:18,代码来源:PartitionIndexIterable.java


示例9: iterator

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public Iterator<Index<T>> iterator() {
    return new Iterator<Index<T>>() {
        private final Iterator<Index<T>> itty = iterable.iterator();

        public void remove() {
            this.itty.remove();
        }

        public Index<T> next() {
            return new EventIndex<T>(this.itty.next(), eventGraph);
        }

        public boolean hasNext() {
            return itty.hasNext();
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:18,代码来源:EventIndexIterable.java


示例10: iterator

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public Iterator<Index<T>> iterator() {
    return new Iterator<Index<T>>() {

        private final Iterator<Index<T>> itty = iterable.iterator();

        public void remove() {
            throw new UnsupportedOperationException();
        }

        public boolean hasNext() {
            return this.itty.hasNext();
        }

        public Index<T> next() {
            return new WrappedIndex<T>(this.itty.next());
        }
    };
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:19,代码来源:WrappedIndexIterable.java


示例11: BlueprintsPersistenceBackend

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
/**
 * Constructs a new {@code BlueprintsPersistenceBackend} wrapping the provided {@code baseGraph}.
 * <p>
 * This constructor initialize the caches and create the metaclass index.
 * <p>
 * This constructor is protected. To create a new {@code BlueprintsPersistenceBackend} use {@link
 * BlueprintsPersistenceBackendFactory#createPersistentBackend(java.io.File, Map)}.
 *
 * @param baseGraph the base {@link KeyIndexableGraph} used to access the database
 *
 * @see BlueprintsPersistenceBackendFactory
 */
protected BlueprintsPersistenceBackend(KeyIndexableGraph baseGraph) {
    this.graph = new AutoCleanerIdGraph(baseGraph);
    this.persistentObjectsCache = Caffeine.newBuilder().softValues().build();
    this.verticesCache = Caffeine.newBuilder().softValues().build();
    this.indexedEClasses = new ArrayList<>();

    Index<Vertex> metaclasses = graph.getIndex(KEY_METACLASSES, Vertex.class);
    if (isNull(metaclasses)) {
        metaclassIndex = graph.createIndex(KEY_METACLASSES, Vertex.class);
    }
    else {
        metaclassIndex = metaclasses;
    }
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:27,代码来源:BlueprintsPersistenceBackend.java


示例12: getIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@Override
public <T extends Element> Index<T> getIndex(String indexName, Class<T> indexClass) {
  if (indexClass == null) {
    throw ExceptionFactory.classForElementCannotBeNull();
  }
  else if (globals.getConfig().getIndexableGraphDisabled()) {
    throw new UnsupportedOperationException("IndexableGraph is disabled via the configuration");
  }

  return globals.getIndexMetadataWrapper().getIndex(indexName, indexClass);
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:12,代码来源:AccumuloGraph.java


示例13: getIndices

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@Override
public Iterable<Index<? extends Element>> getIndices() {
  if (globals.getConfig().getIndexableGraphDisabled()) {
    throw new UnsupportedOperationException("IndexableGraph is disabled via the configuration");
  }
  return globals.getIndexMetadataWrapper().getIndices();
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:8,代码来源:AccumuloGraph.java


示例14: clear

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
/**
 * Clear out this graph. This drops and recreates the backing tables.
 */
public void clear() {
  shutdown();

  try {
    TableOperations tableOps = globals.getConfig()
        .getConnector().tableOperations();
    for (Index<? extends Element> index : getIndices()) {
      tableOps.delete(((AccumuloIndex<? extends Element>)
          index).getTableName());
    }

    for (String table : globals.getConfig().getTableNames()) {
      if (tableOps.exists(table)) {
        tableOps.delete(table);
        tableOps.create(table);

        SortedSet<Text> splits = globals.getConfig().getSplits();
        if (splits != null) {
          tableOps.addSplits(table, splits);
        }
      }
    }
  } catch (Exception e) {
    throw new AccumuloGraphException(e);
  }
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:30,代码来源:AccumuloGraph.java


示例15: getIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public <T extends Element> Index<T> getIndex(String indexName,
    Class<T> indexClass) {
  IndexedItemsListParser parser = new IndexedItemsListParser();

  Scanner scan = null;
  try {
    scan = getScanner();
    scan.fetchColumnFamily(new Text(IndexMetadataEntryType.__INDEX_NAME__.name()));

    for (IndexedItem item : parser.parse(scan)) {
      if (item.getKey().equals(indexName)) {
        if (item.getElementClass().equals(indexClass)) {
          return new AccumuloIndex<T>(globals, indexName,
              indexClass);
        }
        else {
          throw ExceptionFactory.indexDoesNotSupportClass(indexName, indexClass);
        }
      }
    }
    return null;

  } finally {
    if (scan != null) {
      scan.close();
    }
  }
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:29,代码来源:IndexMetadataTableWrapper.java


示例16: createIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public <T extends Element> Index<T> createIndex(String indexName,
    Class<T> indexClass) {
  for (Index<?> index : getIndices()) {
    if (index.getIndexName().equals(indexName)) {
      throw ExceptionFactory.indexAlreadyExists(indexName);
    }
  }

  writeIndexNameEntry(indexName, indexClass);
  return new AccumuloIndex<T>(globals, indexName, indexClass);
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:12,代码来源:IndexMetadataTableWrapper.java


示例17: getIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public <T extends Element> Index<T> getIndex(final String indexName, final Class<T> indexClass) {
    final Index<T> index = this.baseGraph.getIndex(indexName, indexClass);
    if (null == index)
        return null;
    else
        return new com.tinkerpop.blueprints.util.wrappers.event2.EventIndex<T>(index, this);
}
 
开发者ID:dsiegel,项目名称:BlueprintsExperiment,代码行数:8,代码来源:EventIndexableGraph.java


示例18: createIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@Override
    public <T extends Element> Index<T> createIndex(final String indexName, final Class<T> indexClass,
            final Parameter... indexParameters) {
//        return new ActiveVersionedIndex<T, V>(getEventableGraph().createIndex(indexName, indexClass, indexParameters),
//                this);
        throw new IllegalStateException("Currently not supported.");
    }
 
开发者ID:indexiatech,项目名称:antiquity,代码行数:8,代码来源:IndexableTransactionalVersionedGraphImpl.java


示例19: getIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
@Override
    public <T extends Element> Index<T> getIndex(final String indexName, final Class<T> indexClass) {
//        final Index<T> index = getEventableGraph().getIndex(indexName, indexClass);
//        if (null == index) {
//            return null;
//        } else {
//            return new ActiveVersionedIndex<T, V>(index, this);
//        }
        throw new IllegalStateException("Currently not supported.");
    }
 
开发者ID:indexiatech,项目名称:antiquity,代码行数:11,代码来源:IndexableTransactionalVersionedGraphImpl.java


示例20: getIndex

import com.tinkerpop.blueprints.Index; //导入依赖的package包/类
public <T extends Element> Index<T> getIndex(final String indexName, final Class<T> indexClass) {
    final Index<T> index = baseGraph.getIndex(indexName, indexClass);
    if (null == index)
        return null;
    else {
        return new PartitionIndex<T>(index, this);
    }
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:9,代码来源:PartitionIndexableGraph.java



注:本文中的com.tinkerpop.blueprints.Index类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ResourceAwareItemReaderItemStream类代码示例发布时间:2022-05-22
下一篇:
Java TypeInfo类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap