Examples of fileModified()


Examples of com.alimama.mdrill.hdfsDirectory.FileSystemDirectory.fileModified()

        Configuration conf = getConf();
        Path p=this.hdfsLinks.get(name);
       
        try {
        FileSystemDirectory dir=new FileSystemDirectory(FileSystem.get(conf), p.getParent(), false, conf);
        return dir.fileModified(p.getName());
      } catch (IOException e) {
        SolrCore.log.error("hdfs",e);
      }
      }
     
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

                                                         gen);

        // if we are on a filesystem that seems to have only
        // 1 second resolution, allow +1 second in commit
        // age tolerance:
        long modTime = dir.fileModified(fileName);
        oneSecondResolution &= (modTime % 1000) == 0;
        final long leeway = (long) ((SECONDS + (oneSecondResolution ? 1.0:0.0))*1000);

        assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted ", lastDeleteTime - modTime <= leeway);
      } catch (IOException e) {
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

        IndexReader reader = IndexReader.open(dir, true);
        reader.close();
        fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                         "",
                                                         gen);
        long modTime = dir.fileModified(fileName);
        assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted", lastDeleteTime - modTime <= (SECONDS*1000));
      } catch (IOException e) {
        // OK
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

      try {
        IndexReader reader = ia.getReader(false);
        Directory dir = reader.directory();
        try {
          if (dir.fileExists("reopen")) {
            long lastupdate = dir.fileModified("reopen");
            if (lastupdate != lastupdatestored) {
              reopened = true;
              lastupdatestored = lastupdate;
            }
          }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

        IndexReader reader = IndexReader.open(dir);
        reader.close();
        fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                         "",
                                                         gen);
        long modTime = dir.fileModified(fileName);
        assertTrue("commit point was older than " + SECONDS + " seconds but did not get deleted", lastDeleteTime - modTime < (SECONDS*1000));
      } catch (IOException e) {
        // OK
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

        IndexReader reader = IndexReader.open(dir);
        reader.close();
        fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                         "",
                                                         gen);
        long modTime = dir.fileModified(fileName);
        assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted", lastDeleteTime - modTime <= (SECONDS*1000));
      } catch (IOException e) {
        // OK
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

        IndexReader reader = IndexReader.open(dir);
        reader.close();
        fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                         "",
                                                         gen);
        long modTime = dir.fileModified(fileName);
        assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted", lastDeleteTime - modTime <= (SECONDS*1000));
      } catch (IOException e) {
        // OK
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

                                                         gen);

        // if we are on a filesystem that seems to have only
        // 1 second resolution, allow +1 second in commit
        // age tolerance:
        long modTime = dir.fileModified(fileName);
        oneSecondResolution &= (modTime % 1000) == 0;
        final long leeway = (long) ((SECONDS + (oneSecondResolution ? 1.0:0.0))*1000);

        assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted ", lastDeleteTime - modTime <= leeway);
      } catch (IOException e) {
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

        IndexReader reader = IndexReader.open(dir, true);
        reader.close();
        fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                         "",
                                                         gen);
        long modTime = dir.fileModified(fileName);
        assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted", lastDeleteTime - modTime <= (SECONDS*1000));
      } catch (IOException e) {
        // OK
        break;
      }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileModified()

        IndexReader reader = IndexReader.open(dir);
        reader.close();
        fileName = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS,
                                                         "",
                                                         gen);
        long modTime = dir.fileModified(fileName);
        assertTrue("commit point was older than " + SECONDS + " seconds (" + (lastDeleteTime - modTime) + " msec) but did not get deleted", lastDeleteTime - modTime <= (SECONDS*1000));
      } catch (IOException e) {
        // OK
        break;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.