本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException类的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedActionException类的具体用法?Java UnsupportedActionException怎么用?Java UnsupportedActionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnsupportedActionException类属于org.apache.hadoop.hdfs.server.namenode包,在下文中一共展示了UnsupportedActionException类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processOptions
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
if (!args.isEmpty()) {
throw new HadoopIllegalArgumentException("Too many parameters");
}
FileSystem fs = FileSystem.get(getConf());
if (fs instanceof DistributedFileSystem == false) {
throw new UnsupportedActionException(
"Erasure commands are only supported for the HDFS");
}
DistributedFileSystem dfs = (DistributedFileSystem) fs;
ErasureCodingPolicy[] ecPolicies = dfs.getClient().getErasureCodingPolicies();
StringBuilder sb = new StringBuilder();
int i = 0;
while (i < ecPolicies.length) {
ErasureCodingPolicy ecPolicy = ecPolicies[i];
sb.append(ecPolicy.getName());
i++;
if (i < ecPolicies.length) {
sb.append(", ");
}
}
out.println(sb.toString());
}
示例2: checkReplicationPolicyCompatibility
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
private static void checkReplicationPolicyCompatibility(Configuration conf
) throws UnsupportedActionException {
if (!(BlockPlacementPolicy.getInstance(conf, null, null, null) instanceof
BlockPlacementPolicyDefault)) {
throw new UnsupportedActionException(
"Balancer without BlockPlacementPolicyDefault");
}
}
示例3: checkReplicationPolicyCompatibility
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
private static void checkReplicationPolicyCompatibility(Configuration conf
) throws UnsupportedActionException {
BlockPlacementPolicies placementPolicies =
new BlockPlacementPolicies(conf, null, null, null);
if (!(placementPolicies.getPolicy(false) instanceof
BlockPlacementPolicyDefault)) {
throw new UnsupportedActionException(
"Balancer without BlockPlacementPolicyDefault");
}
}
示例4: processPath
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
@Override
protected void processPath(PathData item) throws IOException {
if (!(item.fs instanceof DistributedFileSystem)) {
throw new UnsupportedActionException(
"Erasure commands are only supported for the HDFS paths");
}
}
示例5: checkReplicationPolicyCompatibility
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
private static void checkReplicationPolicyCompatibility(Configuration conf
) throws UnsupportedActionException {
if (!(BlockPlacementPolicy.getInstance(conf, null, null) instanceof
BlockPlacementPolicyDefault)) {
throw new UnsupportedActionException(
"Balancer without BlockPlacementPolicyDefault");
}
}
示例6: checkReplicationPolicyCompatibility
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
private static void checkReplicationPolicyCompatibility(Configuration conf)
throws UnsupportedActionException {
if (BlockPlacementPolicy.getInstance(conf, null, null).getClass() !=
BlockPlacementPolicyDefault.class) {
throw new UnsupportedActionException(
"Balancer without BlockPlacementPolicyDefault");
}
}
示例7: unregister
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
public void unregister(BaseCounter o) throws UnsupportedActionException {
throw new UnsupportedActionException("function isn't supported");
}
示例8: checkReplicationPolicyCompatibility
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
private void checkReplicationPolicyCompatibility(Configuration conf) throws UnsupportedActionException {
if (BlockPlacementPolicy.getInstance(conf, null, null).getClass() !=
BlockPlacementPolicyDefault.class) {
throw new UnsupportedActionException("Balancer without BlockPlacementPolicyDefault");
}
}
示例9: Balancer
import org.apache.hadoop.hdfs.server.namenode.UnsupportedActionException; //导入依赖的package包/类
/** Default constructor */
Balancer() throws UnsupportedActionException {
}