/** Constructs an empty {@link Directory}. */ public RAMDirectory() { this(new SingleInstanceLockFactory()); }
public ByteBuffersDirectory() { this(new SingleInstanceLockFactory()); }
/** * Create a region directory with a given file and chunk region. These regions may be bucket * regions or they may be replicated regions. */ public RegionDirectory(Map fileAndChunkRegion, FileSystemStats stats) { super(new SingleInstanceLockFactory()); fs = new FileSystem(fileAndChunkRegion, stats); }
public void open() throws Exception { if ( !directory.exists() && !directory.mkdirs() ) { throw new IOException("Could not make: " + directory); } IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_35, new KeywordAnalyzer()).setOpenMode(IndexWriterConfig.OpenMode.CREATE); niofsDirectory = new NIOFSDirectory(directory, new SingleInstanceLockFactory()); writer = new IndexWriter(niofsDirectory, conf); }
new SingleInstanceLockFactory()); final UpdateSequence seq = getUpdateSequence(dir); if (since == null) {
public DistributedDirectory(NosqlDirectory nosqlDirectory) throws IOException { this(nosqlDirectory, new SingleInstanceLockFactory()); }
/** Constructs an empty {@link Directory}. */ public RAMDirectory() { this(new SingleInstanceLockFactory()); }
/** Constructs an empty {@link Directory}. */ public RAMDirectory() { this(new SingleInstanceLockFactory()); }
/** Constructs an empty {@link Directory}. */ public RAMDirectory() { this(new SingleInstanceLockFactory()); }
public ByteBuffersDirectory() { this(new SingleInstanceLockFactory()); }
/** Constructs an empty {@link Directory}. */ public RAMDirectory() { setLockFactory(new SingleInstanceLockFactory()); }
/** Constructs an empty {@link Directory}. */ public RAMDirectory() { try { setLockFactory(new SingleInstanceLockFactory()); } catch (IOException e) { // Cannot happen } }
/** Constructs an empty {@link Directory}. */ public RAMDirectory() { setLockFactory(new SingleInstanceLockFactory()); }
@Override public LockFactory createLockFactory(File indexDir, Properties dirConfiguration) { optionValue = dirConfiguration.getProperty( "locking_option" ); return new SingleInstanceLockFactory(); }
public static Directory getDirectory(String path, DirectoryFactory directoryFactory, SolrIndexConfig config) throws IOException { Directory d = directoryFactory.open(path); String rawLockType = (null == config) ? null : config.lockType; if (null == rawLockType) { // we default to "simple" for backwards compatibility log.warn("No lockType configured for " + path + " assuming 'simple'"); rawLockType = "simple"; } final String lockType = rawLockType.toLowerCase().trim(); if ("simple".equals(lockType)) { // multiple SimpleFSLockFactory instances should be OK d.setLockFactory(new SimpleFSLockFactory(path)); } else if ("native".equals(lockType)) { d.setLockFactory(new NativeFSLockFactory(path)); } else if ("single".equals(lockType)) { if (!(d.getLockFactory() instanceof SingleInstanceLockFactory)) d.setLockFactory(new SingleInstanceLockFactory()); } else if ("none".equals(lockType)) { // Recipe for disaster log.error("CONFIGURATION WARNING: locks are disabled on " + path); d.setLockFactory(new NoLockFactory()); } else { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unrecognized lockType: " + rawLockType); } return d; }
public DatabaseDirectory(String tableName) throws IOException{ super(); ModelReflector<IndexDirectory> ref = ModelReflector.instance(IndexDirectory.class); List<IndexDirectory> dirs = new Select().from(IndexDirectory.class).where(new Expression(ref.getPool(),ref.getColumnDescriptor("NAME").getName(),Operator.EQ,tableName)).execute(IndexDirectory.class); if (dirs.size() == 1){ directory = dirs.get(0); } if (directory == null){ throw new FileNotFoundException("Directory entry missing for " + tableName +". Check if there are any field getters marked with annotation @Index in any of it's models."); } setLockFactory(new SingleInstanceLockFactory()); }
lockFactory = new SingleInstanceLockFactory(); } else if (lockFactoryType instanceof String && LuceneEnvironment.LockFactory.Type.NO_LOCKING.equalsIgnoreCase((String) lockFactoryType)) {