Java Code Examples for org.apache.hadoop.util.StringUtils#arrayToString()

The following examples show how to use org.apache.hadoop.util.StringUtils#arrayToString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileName.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private void anonymize(StatePool statePool, Configuration conf) {
  FileNameState fState = (FileNameState) statePool.getState(getClass());
  if (fState == null) {
    fState = new FileNameState();
    statePool.addState(getClass(), fState);
  }
  
  String[] files = StringUtils.split(fileName);
  String[] anonymizedFileNames = new String[files.length];
  int i = 0;
  for (String f : files) {
    anonymizedFileNames[i++] = 
      anonymize(statePool, conf, fState, f);
  }

  anonymizedFileName = StringUtils.arrayToString(anonymizedFileNames);
}
 
Example 2
Source File: FileName.java    From big-c with Apache License 2.0 6 votes vote down vote up
private void anonymize(StatePool statePool, Configuration conf) {
  FileNameState fState = (FileNameState) statePool.getState(getClass());
  if (fState == null) {
    fState = new FileNameState();
    statePool.addState(getClass(), fState);
  }
  
  String[] files = StringUtils.split(fileName);
  String[] anonymizedFileNames = new String[files.length];
  int i = 0;
  for (String f : files) {
    anonymizedFileNames[i++] = 
      anonymize(statePool, conf, fState, f);
  }

  anonymizedFileName = StringUtils.arrayToString(anonymizedFileNames);
}
 
Example 3
Source File: AvatarDataNode.java    From RDFS with Apache License 2.0 6 votes vote down vote up
public static AvatarDataNode makeInstance(String[] dataDirs, Configuration conf)
  throws IOException {
  ArrayList<File> dirs = new ArrayList<File>();
  for (int i = 0; i < dataDirs.length; i++) {
    File data = new File(dataDirs[i]);
    try {
      DiskChecker.checkDir(data);
      dirs.add(data);
    } catch(DiskErrorException e) {
      LOG.warn("Invalid directory in dfs.data.dir: " + e.getMessage());
    }
  }
  if (dirs.size() > 0) {
    String dnThreadName = "AvatarDataNode: [" +
      StringUtils.arrayToString(dataDirs) + "]";
    return new AvatarDataNode(conf, dirs, dnThreadName);
  }
  LOG.error("All directories in dfs.data.dir are invalid.");
  return null;
}