org.apache.hadoop.hbase.client.HBaseAdmin#assign ( )源码实例Demo

下面列出了org.apache.hadoop.hbase.client.HBaseAdmin#assign ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hbase-tools   文件: Common.java
@VisibleForTesting
static void move(Args args, HBaseAdmin admin, String tableName, String targetServerName, String encodedRegionName,
    boolean asynchronous)
    throws IOException, InterruptedException {
    int i;
    for (i = 0; i < Constant.TRY_MAX; i++) {
        try {
            admin.move(encodedRegionName.getBytes(), targetServerName.getBytes());
        } catch (java.lang.reflect.UndeclaredThrowableException ignore) {
        }

        if (asynchronous)
            return;

        if (CommandAdapter.isMetaTable(tableName))
            return;

        if (!isTableEnabled(args, admin, tableName))
            throw new IllegalStateException(Constant.MESSAGE_DISABLED_OR_NOT_FOUND_TABLE);

        if (Util.isMoved(admin, tableName, encodedRegionName, targetServerName)) {
            return;
        }

        Thread.sleep(Constant.WAIT_INTERVAL_MS);

        // assign region again
        if (i >= Constant.TRY_MAX / 2)
            admin.assign(encodedRegionName.getBytes());
    }
    if (i >= Constant.TRY_MAX)
        throw new IllegalStateException(Constant.MESSAGE_CANNOT_MOVE + " - "
            + encodedRegionName + " to " + targetServerName);
}
 
源代码2 项目: hbase-tools   文件: Common.java
@VisibleForTesting
static void move(Args args, HBaseAdmin admin, String tableName, String targetServerName, String encodedRegionName,
    boolean asynchronous)
    throws IOException, InterruptedException {
    int i;
    for (i = 0; i < Constant.TRY_MAX; i++) {
        try {
            admin.move(encodedRegionName.getBytes(), targetServerName.getBytes());
        } catch (java.lang.reflect.UndeclaredThrowableException ignore) {
        }

        if (asynchronous)
            return;

        if (CommandAdapter.isMetaTable(tableName))
            return;

        if (!isTableEnabled(args, admin, tableName))
            throw new IllegalStateException(Constant.MESSAGE_DISABLED_OR_NOT_FOUND_TABLE);

        if (Util.isMoved(admin, tableName, encodedRegionName, targetServerName)) {
            return;
        }

        Thread.sleep(Constant.WAIT_INTERVAL_MS);

        // assign region again
        if (i >= Constant.TRY_MAX / 2)
            admin.assign(encodedRegionName.getBytes());
    }
    if (i >= Constant.TRY_MAX)
        throw new IllegalStateException(Constant.MESSAGE_CANNOT_MOVE + " - "
            + encodedRegionName + " to " + targetServerName);
}
 
源代码3 项目: hbase-tools   文件: Common.java
@VisibleForTesting
static void move(Args args, HBaseAdmin admin, String tableName, String targetServerName, String encodedRegionName,
    boolean asynchronous)
    throws IOException, InterruptedException {
    int i;
    for (i = 0; i < Constant.TRY_MAX; i++) {
        try {
            admin.move(encodedRegionName.getBytes(), targetServerName.getBytes());
        } catch (java.lang.reflect.UndeclaredThrowableException ignore) {
        }

        if (asynchronous)
            return;

        if (CommandAdapter.isMetaTable(tableName))
            return;

        if (!isTableEnabled(args, admin, tableName))
            throw new IllegalStateException(Constant.MESSAGE_DISABLED_OR_NOT_FOUND_TABLE);

        if (Util.isMoved(admin, tableName, encodedRegionName, targetServerName)) {
            return;
        }

        Thread.sleep(Constant.WAIT_INTERVAL_MS);

        // assign region again
        if (i >= Constant.TRY_MAX / 2)
            admin.assign(encodedRegionName.getBytes());
    }
    if (i >= Constant.TRY_MAX)
        throw new IllegalStateException(Constant.MESSAGE_CANNOT_MOVE + " - "
            + encodedRegionName + " to " + targetServerName);
}
 
源代码4 项目: hbase-tools   文件: Common.java
@VisibleForTesting
static void move(Args args, HBaseAdmin admin, String tableName, String targetServerName, String encodedRegionName,
    boolean asynchronous)
    throws IOException, InterruptedException {
    int i;
    for (i = 0; i < Constant.TRY_MAX; i++) {
        try {
            admin.move(encodedRegionName.getBytes(), targetServerName.getBytes());
        } catch (java.lang.reflect.UndeclaredThrowableException ignore) {
        }

        if (asynchronous)
            return;

        if (CommandAdapter.isMetaTable(tableName))
            return;

        if (!isTableEnabled(args, admin, tableName))
            throw new IllegalStateException(Constant.MESSAGE_DISABLED_OR_NOT_FOUND_TABLE);

        if (Util.isMoved(admin, tableName, encodedRegionName, targetServerName)) {
            return;
        }

        Thread.sleep(Constant.WAIT_INTERVAL_MS);

        // assign region again
        if (i >= Constant.TRY_MAX / 2)
            admin.assign(encodedRegionName.getBytes());
    }
    if (i >= Constant.TRY_MAX)
        throw new IllegalStateException(Constant.MESSAGE_CANNOT_MOVE + " - "
            + encodedRegionName + " to " + targetServerName);
}
 
源代码5 项目: hbase-tools   文件: Common.java
@VisibleForTesting
static void move(Args args, HBaseAdmin admin, String tableName, String targetServerName, String encodedRegionName,
    boolean asynchronous)
    throws IOException, InterruptedException {
    int i;
    for (i = 0; i < Constant.TRY_MAX; i++) {
        try {
            admin.move(encodedRegionName.getBytes(), targetServerName.getBytes());
        } catch (java.lang.reflect.UndeclaredThrowableException ignore) {
        }

        if (asynchronous)
            return;

        if (CommandAdapter.isMetaTable(tableName))
            return;

        if (!isTableEnabled(args, admin, tableName))
            throw new IllegalStateException(Constant.MESSAGE_DISABLED_OR_NOT_FOUND_TABLE);

        if (Util.isMoved(admin, tableName, encodedRegionName, targetServerName)) {
            return;
        }

        Thread.sleep(Constant.WAIT_INTERVAL_MS);

        // assign region again
        if (i >= Constant.TRY_MAX / 2)
            admin.assign(encodedRegionName.getBytes());
    }
    if (i >= Constant.TRY_MAX)
        throw new IllegalStateException(Constant.MESSAGE_CANNOT_MOVE + " - "
            + encodedRegionName + " to " + targetServerName);
}