Package com.alibaba.wasp.meta

Examples of com.alibaba.wasp.meta.FTable


    int rowcount = 0;
    return rowcount;
  }

  EntityGroup createEntityGroup(final EntityGroupInfo egi) throws IOException {
    FTable table = FMetaTestUtil.makeTable("TestSplitTransaction");
    return EntityGroup.createEntityGroup(egi, TEST_UTIL.getConfiguration(), table, null);
  }
View Full Code Here


      TEST_UTIL.getConfiguration().set(FConstants.ZOOKEEPER_QUORUM,
          TEST_UTIL.getConfiguration().get(HConstants.ZOOKEEPER_QUORUM));
      TEST_UTIL.getConfiguration().set(FConstants.ZOOKEEPER_CLIENT_PORT,
          TEST_UTIL.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT));
      final Server server = new MockServer(TEST_UTIL);
      FTable htd = FMetaTestUtil
          .makeTable("testShouldNotCompeleteOpenedEntityGroupSuccessfullyIfVersionMismatches");
      EntityGroupInfo egi = new EntityGroupInfo(Bytes.toBytes(htd
          .getTableName()), Bytes.toBytes(testIndex),
          Bytes.toBytes(testIndex + 1));
      entityGroup = EntityGroup.createEntityGroup(egi,
          TEST_UTIL.getConfiguration(), htd, null);
      assertNotNull(entityGroup);
View Full Code Here

    TEST_UTIL.createTable(tableName);
    tables = admin.listTables();
    assertEquals(numTables + 1, tables.length);

    // FIRST, do FTable changes.
    FTable fTable = admin.getTableDescriptor(tableName);
    // Make a copy and assert copy is good.
    FTable copy = FMetaTestUtil.makeTable(fTable.getTableName());
    assertTrue(fTable.equals(copy));

    boolean expectedException = false;
    try {
      modifyTable(tableName, copy);
View Full Code Here

        new byte[] { 3, 3, 3 }, new byte[] { 4, 4, 4 }, new byte[] { 5, 5, 5 },
        new byte[] { 6, 6, 6 }, new byte[] { 7, 7, 7 }, new byte[] { 8, 8, 8 },
        new byte[] { 9, 9, 9 }, };
    int expectedEntityGroups = splitKeys.length + 1;

    FTable desc = FMetaTestUtil.makeTable(Bytes.toString(tableName));
    admin.createTable(desc, splitKeys);

    Map<EntityGroupInfo, ServerName> entityGroups = admin
        .getEntityGroupLocations(tableName);
    assertEquals("Tried to create " + expectedEntityGroups + " entityGroups "
View Full Code Here

  @Test
  public void testCreateTableWithOnlyEmptyStartRow() throws IOException {
    byte[][] splitKeys = new byte[1][];
    splitKeys[0] = FConstants.EMPTY_BYTE_ARRAY;
    FTable desc = FMetaTestUtil
        .makeTable("testCreateTableWithOnlyEmptyStartRow");
    try {
      admin.createTable(desc, splitKeys);
      fail("Test case should fail as empty split key is passed.");
    } catch (IllegalArgumentException e) {
View Full Code Here

  public void testCreateTableWithEmptyRowInTheSplitKeys() throws IOException {
    byte[][] splitKeys = new byte[3][];
    splitKeys[0] = "entityGroup1".getBytes();
    splitKeys[1] = FConstants.EMPTY_BYTE_ARRAY;
    splitKeys[2] = "entityGroup2".getBytes();
    FTable desc = FMetaTestUtil
        .makeTable("testCreateTableWithEmptyRowInTheSplitKeys");
    try {
      admin.createTable(desc, splitKeys);
      fail("Test case should fail as empty split key is passed.");
    } catch (IllegalArgumentException e) {
View Full Code Here

   *
   * @throws java.io.IOException
   */
  @Test(expected = IllegalArgumentException.class)
  public void testEmptyFTable() throws IOException {
    admin.createTable(new FTable());
  }
View Full Code Here

    byte[] tableName = Bytes.toBytes("testGetTableEntityGroups");
    int expectedEntityGroups = 10;
    // Use 80 bit numbers to make sure we aren't limited
    byte[] startKey = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
    byte[] endKey = { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 };
    FTable desc = FMetaTestUtil.makeTable("testGetTableEntityGroups");
    admin.createTable(desc, startKey, endKey, expectedEntityGroups);
    List<EntityGroupInfo> egis = admin.getTableEntityGroups(tableName);
    assertEquals("Tried to create " + expectedEntityGroups + " EntityGroups "
        + "but only found " + egis.size(), expectedEntityGroups, egis.size());
  }
View Full Code Here

   */
  @Test(timeout = 120000)
  public void testAssignEntityGroup() throws Exception {
    String table = "testAssignEntityGroup";
    try {
      FTable desc = FMetaTestUtil.makeTable(table);
      admin.createTable(desc);
      EntityGroupInfo egInfo = new EntityGroupInfo(Bytes.toBytes(desc
          .getTableName()), Bytes.toBytes("A"), Bytes.toBytes("Z"));
      FMetaEditor.addEntityGroupToMeta(conf, egInfo);
      FMaster master = TEST_UTIL.getWaspCluster().getMaster();
      master.assignEntityGroup(egInfo);
      master.getAssignmentManager().waitForAssignment(egInfo);
View Full Code Here

    }
  }

  EntityGroupInfo createTableAndGetOneEntityGroup(final String tableName)
      throws IOException, InterruptedException {
    FTable desc = FMetaTestUtil.makeTable(tableName);
    admin.createTable(desc, Bytes.toBytes("A"), Bytes.toBytes("Z"), 5);

    // wait till the table is assigned
    FMaster master = TEST_UTIL.getWaspCluster().getMaster();
    long timeoutTime = System.currentTimeMillis() + 100;
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.meta.FTable

Copyright © 2018 www.massapicom. 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.