@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()); }
private static void checkReplicationPolicyCompatibility(Configuration conf ) throws UnsupportedActionException { if (!(BlockPlacementPolicy.getInstance(conf, null, null, null) instanceof BlockPlacementPolicyDefault)) { throw new UnsupportedActionException( "Balancer without BlockPlacementPolicyDefault"); } }
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"); } }
@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"); } }
private static void checkReplicationPolicyCompatibility(Configuration conf ) throws UnsupportedActionException { if (!(BlockPlacementPolicy.getInstance(conf, null, null) instanceof BlockPlacementPolicyDefault)) { throw new UnsupportedActionException( "Balancer without BlockPlacementPolicyDefault"); } }
private static void checkReplicationPolicyCompatibility(Configuration conf) throws UnsupportedActionException { if (BlockPlacementPolicy.getInstance(conf, null, null).getClass() != BlockPlacementPolicyDefault.class) { throw new UnsupportedActionException( "Balancer without BlockPlacementPolicyDefault"); } }
public void unregister(BaseCounter o) throws UnsupportedActionException { throw new UnsupportedActionException("function isn't supported"); }
public void unregister(BaseCounter o) throws UnsupportedActionException { throw new UnsupportedActionException("function is not supported"); }
private void checkReplicationPolicyCompatibility(Configuration conf) throws UnsupportedActionException { if (BlockPlacementPolicy.getInstance(conf, null, null).getClass() != BlockPlacementPolicyDefault.class) { throw new UnsupportedActionException("Balancer without BlockPlacementPolicyDefault"); } }
/** Default constructor */ Balancer() throws UnsupportedActionException { }
/** Construct a balancer from the given configuration */ Balancer(Configuration conf) throws UnsupportedActionException { checkReplicationPolicyCompatibility(conf); setConf(conf); }
/** Construct a balancer from the given configuration and threshold */ Balancer(Configuration conf, double threshold) throws UnsupportedActionException { checkReplicationPolicyCompatibility(conf); setConf(conf); this.threshold = threshold; }