Examples of snapshot()


Examples of org.apache.hadoop.hbase.ipc.HMasterInterface.snapshot()

    Mockito.when(mockConnection.getConfiguration()).thenReturn(conf);
    Mockito.when(mockConnection.getMaster()).thenReturn(mockMaster);
    // set the max wait time for the snapshot to complete
    Mockito
        .when(
          mockMaster.snapshot(
            Mockito.any(HSnapshotDescription.class))).thenReturn((long)maxWaitTime);

    // first five times, we return false, last we get success
    Mockito.when(
      mockMaster.isSnapshotDone(
View Full Code Here

Examples of org.apache.hadoop.hbase.ipc.HMasterInterface.snapshot()

    // mock the master connection
    HMasterInterface master = Mockito.mock(HMasterInterface.class);
    Mockito.when(mockConnection.getMaster()).thenReturn(master);

    Mockito.when(
      master.snapshot(Mockito.any(HSnapshotDescription.class))).thenReturn((long)0);
    Mockito.when(
      master.isSnapshotDone(
        Mockito.any(HSnapshotDescription.class))).thenReturn(true);

      // make sure that we can use valid names
View Full Code Here

Examples of org.apache.lucene.index.SnapshotDeletionPolicy.snapshot()

    writer.setMaxBufferedDocs(2);
    Document doc = new Document();
    doc.add(new Field("content", "aaa", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
    for(int i=0;i<7;i++)
      writer.addDocument(doc);
    IndexCommit cp = (IndexCommit) dp.snapshot();
    copyFiles(dir, cp);
    writer.close();
    copyFiles(dir, cp);
   
    writer = new IndexWriter(dir, true, new StandardAnalyzer(), dp);
View Full Code Here

Examples of org.apache.lucene.index.SnapshotDeletionPolicy.snapshot()

    writer.addDocument(new Document());
    writer.commit();
   
    String s1 = "s1";
    String s2 = "s2";
    IndexCommit ic1 = sdp.snapshot(s1);
    IndexCommit ic2 = sdp.snapshot(s2);
    assertTrue(ic1 == ic2); // should be the same instance
   
    // create another commit
    writer.addDocument(new Document());
View Full Code Here

Examples of org.apache.lucene.index.SnapshotDeletionPolicy.snapshot()

    writer.commit();
   
    String s1 = "s1";
    String s2 = "s2";
    IndexCommit ic1 = sdp.snapshot(s1);
    IndexCommit ic2 = sdp.snapshot(s2);
    assertTrue(ic1 == ic2); // should be the same instance
   
    // create another commit
    writer.addDocument(new Document());
    writer.commit();
View Full Code Here

Examples of org.apache.lucene.index.SnapshotDeletionPolicy.snapshot()

    Directory dir = newDirectory();
    SnapshotDeletionPolicy sdp = getDeletionPolicy();
    IndexWriter writer = new IndexWriter(dir, getConfig(random, sdp));
    writer.addDocument(new Document());
    writer.commit();
    IndexCommit ic = sdp.snapshot("s1");

    // create another commit, not snapshotted.
    writer.addDocument(new Document());
    writer.close();
View Full Code Here

Examples of org.apache.lucene.index.SnapshotDeletionPolicy.snapshot()

        @Override
        public void run() {
          try {
            writer.addDocument(new Document());
            writer.commit();
            sdp.snapshot(getName());
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
      };
View Full Code Here

Examples of org.apache.lucene.index.SnapshotDeletionPolicy.snapshot()

        Thread commitThread =  new Thread(new Runnable() {
            @Override
            public void run() {
              try {
                iw.commit();
                IndexCommit ic = sdp.snapshot();
                for (String name : ic.getFileNames()) {
                  //distribute, and backup
                  //System.out.println(names);
                  assertTrue(dir.fileExists(name));
                }
View Full Code Here

Examples of org.apache.lucene.index.SnapshotDeletionPolicy.snapshot()

          name, _tableContext.getTable(), _shardContext.getShard());
      throw new IOException("A Snapshot already exists with the same name [" + name + "] on " +
        "["+_tableContext.getTable()+"/"+_shardContext.getShard()+"].");
    }
    _writer.commit();
    IndexCommit indexCommit = snapshotter.snapshot(name);
   
    /*
     * Persist the snapshots info into a tmp file under the snapshots sub-folder
     * and once writing is finished, close the writer.
     * Now rename the tmp file to an actual snapshots file.
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.status.IndicesStatusRequest.snapshot()

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        IndicesStatusRequest indicesStatusRequest = new IndicesStatusRequest(splitIndices(request.param("index")));
        // we just send back a response, no need to fork a listener
        indicesStatusRequest.listenerThreaded(false);
        indicesStatusRequest.recovery(request.paramAsBoolean("recovery", indicesStatusRequest.recovery()));
        indicesStatusRequest.snapshot(request.paramAsBoolean("snapshot", indicesStatusRequest.snapshot()));
        BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
        if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
            // since we don't spawn, don't allow no_threads, but change it to a single thread
            operationThreading = BroadcastOperationThreading.SINGLE_THREAD;
        }
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.