本文整理汇总了Java中org.neo4j.helpers.collection.IteratorUtil.asList方法的典型用法代码示例。如果您正苦于以下问题:Java IteratorUtil.asList方法的具体用法?Java IteratorUtil.asList怎么用?Java IteratorUtil.asList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.helpers.collection.IteratorUtil
的用法示例。
在下文中一共展示了IteratorUtil.asList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nodeIdsInIndex
import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
private List<Long> nodeIdsInIndex( int indexId, String value ) throws IOException
{
Config config = new Config();
SchemaIndexProvider indexProvider = new LuceneSchemaIndexProvider( new DefaultFileSystemAbstraction(),
DirectoryFactory.PERSISTENT, directory.graphDbDir() );
IndexConfiguration indexConfig = new IndexConfiguration( false );
IndexSamplingConfig samplingConfig = new IndexSamplingConfig( config );
try ( IndexAccessor accessor = indexProvider.getOnlineAccessor( indexId, indexConfig, samplingConfig );
IndexReader reader = accessor.newReader() )
{
return IteratorUtil.asList( reader.seek( value ) );
}
}
示例2: NeoConstraint
import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
public NeoConstraint(boolean constraint, boolean index, Iterable<String>propKeys, Label label, ConstraintType type) {
this.constraint = constraint;
this.index = index;
this.type = type;
this.propertyKeys = IteratorUtil.asList(propKeys);
this.label = (label == null ? "N/A" : label.name());
}
示例3: verifyThatIndexCreationTransactionIsTheFirstOne
import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
private void verifyThatIndexCreationTransactionIsTheFirstOne() throws Exception
{
NeoStoreDataSource ds = db.getDependencyResolver().resolveDependency( NeoStoreDataSource.class );
PhysicalLogFile pLogFile = db.getDependencyResolver().resolveDependency( PhysicalLogFile.class );
long version = ds.getCurrentLogVersion();
db.getDependencyResolver().resolveDependency( LogRotation.class ).rotateLogFile();
db.getDependencyResolver().resolveDependency( CheckPointer.class ).forceCheckPoint(
new SimpleTriggerInfo( "test" )
);
ReadableVersionableLogChannel logChannel = pLogFile.getReader( LogPosition.start( version ) );
final AtomicBoolean success = new AtomicBoolean( false );
try ( IOCursor<LogEntry> cursor = new LogEntryCursor( logChannel ) )
{
List<Command> commandsInFirstEntry = new ArrayList<>();
boolean startFound = false;
while ( cursor.next() )
{
LogEntry entry = cursor.get();
if ( entry instanceof LogEntryStart )
{
if ( startFound )
{
throw new IllegalArgumentException( "More than one start entry" );
}
startFound = true;
}
if ( startFound && entry instanceof LogEntryCommand )
{
commandsInFirstEntry.add( entry.<LogEntryCommand>as().getXaCommand() );
}
if ( entry instanceof LogEntryCommit )
{
// The first COMMIT
assertTrue( startFound );
assertFalse( "Index creation transaction wasn't the first one", commandsInFirstEntry.isEmpty() );
List<Command> createCommands = IteratorUtil.asList( new FilteringIterator<>(
commandsInFirstEntry.iterator(),
new Predicate<Command>()
{
@Override
public boolean test( Command item )
{
return item instanceof IndexDefineCommand;
}
}
) );
assertEquals( 1, createCommands.size() );
success.set( true );
break;
}
}
}
assertTrue( "Didn't find any commit record in log " + version, success.get() );
}
示例4: People
import org.neo4j.helpers.collection.IteratorUtil; //导入方法依赖的package包/类
public People(Iterator<String> names) {
this.names = IteratorUtil.asList(names);
}