当前位置: 首页>>代码示例>>Java>>正文


Java SnapshotTestingUtils.verifyRowCount方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils.verifyRowCount方法的典型用法代码示例。如果您正苦于以下问题:Java SnapshotTestingUtils.verifyRowCount方法的具体用法?Java SnapshotTestingUtils.verifyRowCount怎么用?Java SnapshotTestingUtils.verifyRowCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils的用法示例。


在下文中一共展示了SnapshotTestingUtils.verifyRowCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCloneSnapshotOfCloned

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testCloneSnapshotOfCloned() throws IOException, InterruptedException {
  TableName clonedTableName =
      TableName.valueOf("clonedtb-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName0, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);
  SnapshotTestingUtils.verifyReplicasCameOnline(clonedTableName, admin, getNumReplicas());
  admin.disableTable(clonedTableName);
  admin.snapshot(snapshotName2, clonedTableName);
  TEST_UTIL.deleteTable(clonedTableName);
  waitCleanerRun();

  admin.cloneSnapshot(snapshotName2, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);
  SnapshotTestingUtils.verifyReplicasCameOnline(clonedTableName, admin, getNumReplicas());
  TEST_UTIL.deleteTable(clonedTableName);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:TestRestoreSnapshotFromClient.java

示例2: testCloneAndRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testCloneAndRestoreSnapshot() throws IOException, InterruptedException {
  TEST_UTIL.deleteTable(tableName);
  waitCleanerRun();

  admin.cloneSnapshot(snapshotName0, tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);
  SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());
  waitCleanerRun();

  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName0);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);
  SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestRestoreSnapshotFromClient.java

示例3: testRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testRestoreSnapshot() throws IOException {
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);

  // Restore from snapshot-0
  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName0);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);

  // Restore from emptySnapshot
  admin.disableTable(tableName);
  admin.restoreSnapshot(emptySnapshot);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, 0);

  // Restore from snapshot-1
  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName1);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:23,代码来源:TestRestoreSnapshotFromClient.java

示例4: testRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testRestoreSnapshot() throws IOException {
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
  admin.disableTable(tableName);
  admin.snapshot(snapshotName1, tableName);
  // Restore from snapshot-0
  admin.restoreSnapshot(snapshotName0);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);
  SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());

  // Restore from emptySnapshot
  admin.disableTable(tableName);
  admin.restoreSnapshot(emptySnapshot);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, 0);
  SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());

  // Restore from snapshot-1
  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName1);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
  SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());

  // Restore from snapshot-1
  TEST_UTIL.deleteTable(tableName);
  admin.restoreSnapshot(snapshotName1);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
  SnapshotTestingUtils.verifyReplicasCameOnline(tableName, admin, getNumReplicas());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:32,代码来源:TestRestoreSnapshotFromClient.java

示例5: testCloneSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
private void testCloneSnapshot(final TableName tableName, final byte[] snapshotName,
    int snapshotRows) throws IOException, InterruptedException {
  // create a new table from snapshot
  admin.cloneSnapshot(snapshotName, tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshotRows);

  verifyReplicasCameOnline(tableName);
  TEST_UTIL.deleteTable(tableName);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:TestCloneSnapshotFromClient.java

示例6: testCloneSnapshotOfCloned

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testCloneSnapshotOfCloned() throws IOException, InterruptedException {
  byte[] clonedTableName = Bytes.toBytes("clonedtb-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName0, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);
  admin.disableTable(clonedTableName);
  admin.snapshot(snapshotName2, clonedTableName);
  admin.deleteTable(clonedTableName);
  waitCleanerRun();

  admin.cloneSnapshot(snapshotName2, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);
  TEST_UTIL.deleteTable(clonedTableName);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:15,代码来源:TestRestoreSnapshotFromClient.java

示例7: testCloneAndRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testCloneAndRestoreSnapshot() throws IOException, InterruptedException {
  TEST_UTIL.deleteTable(tableName);
  waitCleanerRun();

  admin.cloneSnapshot(snapshotName0, tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);
  waitCleanerRun();

  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName0);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:15,代码来源:TestRestoreSnapshotFromClient.java

示例8: testCloneSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
private void testCloneSnapshot(final byte[] tableName, final byte[] snapshotName,
    int snapshotRows) throws IOException, InterruptedException {
  // create a new table from snapshot
  admin.cloneSnapshot(snapshotName, tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshotRows);

  TEST_UTIL.deleteTable(tableName);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:9,代码来源:TestCloneSnapshotFromClient.java

示例9: testRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testRestoreSnapshot() throws IOException {
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
  admin.disableTable(tableName);
  admin.snapshot(snapshotName1, tableName);
  // Restore from snapshot-0
  admin.restoreSnapshot(snapshotName0);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);

  // Restore from emptySnapshot
  admin.disableTable(tableName);
  admin.restoreSnapshot(emptySnapshot);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, 0);

  // Restore from snapshot-1
  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName1);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);

  // Restore from snapshot-1
  TEST_UTIL.deleteTable(tableName);
  admin.restoreSnapshot(snapshotName1);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:28,代码来源:TestRestoreSnapshotFromClient.java

示例10: testCloneSnapshotOfCloned

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testCloneSnapshotOfCloned() throws IOException, InterruptedException {
  TableName clonedTableName =
      TableName.valueOf("clonedtb-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName0, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);
  admin.disableTable(clonedTableName);
  admin.snapshot(snapshotName2, clonedTableName);
  TEST_UTIL.deleteTable(clonedTableName);
  waitCleanerRun();

  admin.cloneSnapshot(snapshotName2, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);
  TEST_UTIL.deleteTable(clonedTableName);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:16,代码来源:TestRestoreSnapshotFromClient.java

示例11: testCloneSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
private void testCloneSnapshot(final TableName tableName, final byte[] snapshotName,
    int snapshotRows) throws IOException, InterruptedException {
  // create a new table from snapshot
  admin.cloneSnapshot(snapshotName, tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshotRows);

  TEST_UTIL.deleteTable(tableName);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:9,代码来源:TestCloneSnapshotFromClient.java

示例12: validateSnapshotRestore

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
private void validateSnapshotRestore() throws IOException {
  try {
    UTIL.getAdmin().enableTable(snapshotTableName);

    HTableDescriptor currentHTD = UTIL.getAdmin().getTableDescriptor(snapshotTableName);
    assertTrue(currentHTD.hasFamily(CF1));
    assertTrue(currentHTD.hasFamily(CF2));
    assertFalse(currentHTD.hasFamily(CF3));
    assertFalse(currentHTD.hasFamily(CF4));
    assertEquals(currentHTD.getFamiliesKeys().size(), snapshotHTD.getFamiliesKeys().size());
    SnapshotTestingUtils.verifyRowCount(UTIL, snapshotTableName, rowCountCF1 + rowCountCF2);
  } finally {
    UTIL.getAdmin().disableTable(snapshotTableName);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:16,代码来源:TestRestoreSnapshotProcedure.java

示例13: testRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
@Test
public void testRestoreSnapshot() throws IOException {
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);

  // Restore from snapshot-0
  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName0);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot0Rows);

  // Restore from emptySnapshot
  admin.disableTable(tableName);
  admin.restoreSnapshot(emptySnapshot);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, 0);

  // Restore from snapshot-1
  admin.disableTable(tableName);
  admin.restoreSnapshot(snapshotName1);
  admin.enableTable(tableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);

  // Restore from snapshot-1
  TEST_UTIL.deleteTable(tableName);
  admin.restoreSnapshot(snapshotName1);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, tableName, snapshot1Rows);
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:28,代码来源:TestRestoreSnapshotFromClient.java

示例14: testCloneLinksAfterDelete

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
/**
 * Verify that tables created from the snapshot are still alive after source table deletion.
 */
@Test
public void testCloneLinksAfterDelete() throws IOException, InterruptedException {
  // Clone a table from the first snapshot
  TableName clonedTableName = TableName.valueOf("clonedtb1-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName0, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);

  // Take a snapshot of this cloned table.
  admin.disableTable(clonedTableName);
  admin.snapshot(snapshotName2, clonedTableName);

  // Clone the snapshot of the cloned table
  TableName clonedTableName2 = TableName.valueOf("clonedtb2-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName2, clonedTableName2);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName2, snapshot0Rows);
  admin.disableTable(clonedTableName2);

  // Remove the original table
  TEST_UTIL.deleteTable(tableName);
  waitCleanerRun();

  // Verify the first cloned table
  admin.enableTable(clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);

  // Verify the second cloned table
  admin.enableTable(clonedTableName2);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName2, snapshot0Rows);
  admin.disableTable(clonedTableName2);

  // Delete the first cloned table
  TEST_UTIL.deleteTable(clonedTableName);
  waitCleanerRun();

  // Verify the second cloned table
  admin.enableTable(clonedTableName2);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName2, snapshot0Rows);

  // Clone a new table from cloned
  TableName clonedTableName3 = TableName.valueOf("clonedtb3-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName2, clonedTableName3);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName3, snapshot0Rows);

  // Delete the cloned tables
  TEST_UTIL.deleteTable(clonedTableName2);
  TEST_UTIL.deleteTable(clonedTableName3);
  admin.deleteSnapshot(snapshotName2);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:52,代码来源:TestCloneSnapshotFromClient.java

示例15: testCloneLinksAfterDelete

import org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils; //导入方法依赖的package包/类
/**
 * Verify that tables created from the snapshot are still alive after source table deletion.
 */
@Test
public void testCloneLinksAfterDelete() throws IOException, InterruptedException {
  // Clone a table from the first snapshot
  byte[] clonedTableName = Bytes.toBytes("clonedtb1-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName0, clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);

  // Take a snapshot of this cloned table.
  admin.disableTable(clonedTableName);
  admin.snapshot(snapshotName2, clonedTableName);

  // Clone the snapshot of the cloned table
  byte[] clonedTableName2 = Bytes.toBytes("clonedtb2-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName2, clonedTableName2);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName2, snapshot0Rows);
  admin.disableTable(clonedTableName2);

  // Remove the original table
  TEST_UTIL.deleteTable(tableName);
  waitCleanerRun();

  // Verify the first cloned table
  admin.enableTable(clonedTableName);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName, snapshot0Rows);

  // Verify the second cloned table
  admin.enableTable(clonedTableName2);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName2, snapshot0Rows);
  admin.disableTable(clonedTableName2);

  // Delete the first cloned table
  TEST_UTIL.deleteTable(clonedTableName);
  waitCleanerRun();

  // Verify the second cloned table
  admin.enableTable(clonedTableName2);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName2, snapshot0Rows);

  // Clone a new table from cloned
  byte[] clonedTableName3 = Bytes.toBytes("clonedtb3-" + System.currentTimeMillis());
  admin.cloneSnapshot(snapshotName2, clonedTableName3);
  SnapshotTestingUtils.verifyRowCount(TEST_UTIL, clonedTableName3, snapshot0Rows);

  // Delete the cloned tables
  TEST_UTIL.deleteTable(clonedTableName2);
  TEST_UTIL.deleteTable(clonedTableName3);
  admin.deleteSnapshot(snapshotName2);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:52,代码来源:TestCloneSnapshotFromClient.java


注:本文中的org.apache.hadoop.hbase.snapshot.SnapshotTestingUtils.verifyRowCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。