Tabnine Logo
SimpleFSLockFactory.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.lucene.store.SimpleFSLockFactory
constructor

Best Java code snippets using org.apache.lucene.store.SimpleFSLockFactory.<init> (Showing top 9 results out of 315)

origin: sismics/reader

@Override
protected void startUp() {
  // RAM directory storage by default
  if (luceneStorageConfig == null || luceneStorageConfig.equals(Constants.LUCENE_DIRECTORY_STORAGE_RAM)) {
    directory = new RAMDirectory();
    log.info("Using RAM Lucene storage");
  } else if (luceneStorageConfig.equals(Constants.LUCENE_DIRECTORY_STORAGE_FILE)) {
    File luceneDirectory = DirectoryUtil.getLuceneDirectory();
    log.info("Using file Lucene storage: {}", luceneDirectory);
    try {
      directory = new SimpleFSDirectory(luceneDirectory, new SimpleFSLockFactory());
    } catch (IOException e) {
      log.error("Error initializing Lucene index", e);
    }
  }
}
origin: org.dspace.dependencies.solr/dspace-solr-core

public SnapShooter(SolrCore core, String location) throws IOException {
 solrCore = core;
 if (location == null) snapDir = core.getDataDir();
 else  {
  File base = new File(core.getCoreDescriptor().getInstanceDir());
  snapDir = org.apache.solr.common.util.FileUtils.resolvePath(base, location).getAbsolutePath();
  File dir = new File(snapDir);
  if (!dir.exists())  dir.mkdirs();
 }
 lockFactory = new SimpleFSLockFactory(snapDir);
}
origin: org.alfresco/alfresco-repository

lockFactory = new SimpleFSLockFactory(path);
doClearLockID = true;
origin: org.apache.lucene/com.springsource.org.apache.lucene

lockFactory = new SimpleFSLockFactory(path);
doClearLockID = true;
origin: org.apache.lucene/lucene-core-jfrog

lockFactory = new SimpleFSLockFactory(path);
doClearLockID = true;
origin: Alfresco/alfresco-repository

lockFactory = new SimpleFSLockFactory(path);
doClearLockID = true;
origin: org.compass-project/compass

public Directory open(String subContext, String subIndex) throws SearchEngineException {
  try {
    String path = buildPath(subContext, subIndex);
    Directory dir =  FSDirectory.getDirectory(path);
    dir.setLockFactory(new SimpleFSLockFactory(path));
    return dir;
  } catch (IOException e) {
    throw new SearchEngineException("Failed to open directory for path [" + subIndex + "]", e);
  }
}
origin: org.dspace.dependencies.solr/dspace-solr-core

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;
}

origin: org.compass-project/compass

  lockFactory = new SimpleFSLockFactory(lockDir);
} catch (IOException e) {
  throw new SearchEngineException("Failed to create simple fs lock factory with lock dir [" + lockDir + "]", e);
org.apache.lucene.storeSimpleFSLockFactory<init>

Javadoc

Create a SimpleFSLockFactory instance, with null (unset) lock directory. When you pass this factory to a FSDirectorysubclass, the lock directory is automatically set to the directory itself. Be sure to create one instance for each directory your create!

Popular methods of SimpleFSLockFactory

  • setLockDir
    Set the lock directory. This is package-private and is only used externally by FSDirectory when crea
  • makeLock

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now