Examples of snapshot()


Examples of org.apache.hadoop.hbase.client.HBaseAdmin.snapshot()

      }
    } while (fail);

    // snapshot the non-existant table
    try {
      admin.snapshot("fail", tableName, SnapshotDescription.Type.FLUSH);
      fail("Snapshot succeeded even though there is not table.");
    } catch (SnapshotCreationException e) {
      LOG.info("Correctly failed to snapshot a non-existant table:" + e.getMessage());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.snapshot()

    for (HRegion region : onlineRegions) {
      region.waitForFlushesAndCompactions();
    }
    String snapshotName = "flushSnapshotCreateListDestroy";
    // test creating the snapshot
    admin.snapshot(snapshotName, STRING_TABLE_NAME, SnapshotDescription.Type.FLUSH);
    logFSTree(new Path(UTIL.getConfiguration().get(HConstants.HBASE_DIR)));

    // make sure we only have 1 matching snapshot
    List<SnapshotDescription> snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,
      snapshotName, STRING_TABLE_NAME);
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.snapshot()

        FSUtils.getRootDir(UTIL.getConfiguration()), LOG);

    // take a snapshot of the enabled table
    String snapshotString = "offlineTableSnapshot";
    byte[] snapshot = Bytes.toBytes(snapshotString);
    admin.snapshot(snapshotString, STRING_TABLE_NAME, SnapshotDescription.Type.FLUSH);
    LOG.debug("Snapshot completed.");

    // make sure we have the snapshot
    List<SnapshotDescription> snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,
      snapshot, TABLE_NAME);
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.snapshot()

      }
    } while (fail);

    // snapshot the non-existant table
    try {
      admin.snapshot("fail", tableName, SnapshotDescription.Type.FLUSH);
      fail("Snapshot succeeded even though there is not table.");
    } catch (SnapshotCreationException e) {
      LOG.info("Correctly failed to snapshot a non-existant table:" + e.getMessage());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.snapshot()

    // load the table so we have some data
    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, numRows, TEST_FAM);

    // Take a snapshot
    String snapshotBeforeMergeName = "snapshotBeforeMerge";
    admin.snapshot(snapshotBeforeMergeName, STRING_TABLE_NAME, SnapshotDescription.Type.FLUSH);

    // Clone the table
    String cloneBeforeMergeName = "cloneBeforeMerge";
    admin.cloneSnapshot(snapshotBeforeMergeName, cloneBeforeMergeName);
    SnapshotTestingUtils.waitForTableToBeOnline(UTIL, TableName.valueOf(cloneBeforeMergeName));
View Full Code Here

Examples of org.apache.hadoop.hbase.client.HBaseAdmin.snapshot()

    // load the table so we have some data
    SnapshotTestingUtils.loadData(UTIL, TABLE_NAME, DEFAULT_NUM_ROWS, TEST_FAM);

    String snapshotName = "flushSnapshotCreateListDestroy";
    // test creating the snapshot
    admin.snapshot(snapshotName, STRING_TABLE_NAME, SnapshotDescription.Type.FLUSH);
    logFSTree(FSUtils.getRootDir(UTIL.getConfiguration()));

    // make sure we only have 1 matching snapshot
    List<SnapshotDescription> snapshots = SnapshotTestingUtils.assertOneSnapshotThatMatches(admin,
      snapshotName, TABLE_NAME);
View Full Code Here

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(
        Mockito.any(HSnapshotDescription.class))).thenReturn(false, false,
View Full Code Here

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.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(
        Mockito.any(HSnapshotDescription.class))).thenReturn(false, false,
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.