Java 类org.apache.hadoop.fs.FsShell.CmdHandler 实例源码

项目:hadoop-EAR    文件:FsShellPermissions.java   
static void changePermissions(String cmd, String argv[], int startIndex,
    FsShell shell) throws IOException {
  CmdHandler handler = null;
  boolean recursive = false;

  // handle common arguments, currently only "-R" 
  for (; startIndex < argv.length && argv[startIndex].equals("-R"); 
  startIndex++) {
    recursive = true;
  }

  if ( startIndex >= argv.length ) {
    throw new IOException("Not enough arguments for the command");
  }

  if (cmd.equals("-chmod")) {
    handler = new ChmodHandler(argv[startIndex++]);
  } else if (cmd.equals("-chown")) {
    handler = new ChownHandler(argv[startIndex++]);
  } else if (cmd.equals("-chgrp")) {
    handler = new ChgrpHandler(argv[startIndex++]);
  }

  shell.runCmdHandler(handler, argv, startIndex, recursive);
}
项目:hadoop-on-lustre    文件:FsShellPermissions.java   
static int changePermissions(FileSystem fs, String cmd, 
                              String argv[], int startIndex, FsShell shell)
                              throws IOException {
  CmdHandler handler = null;
  boolean recursive = false;

  // handle common arguments, currently only "-R" 
  for (; startIndex < argv.length && argv[startIndex].equals("-R"); 
  startIndex++) {
    recursive = true;
  }

  if ( startIndex >= argv.length ) {
    throw new IOException("Not enough arguments for the command");
  }

  if (cmd.equals("-chmod")) {
    handler = new ChmodHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chown")) {
    handler = new ChownHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chgrp")) {
    handler = new ChgrpHandler(fs, argv[startIndex++]);
  }

  return shell.runCmdHandler(handler, argv, startIndex, recursive);
}
项目:RDFS    文件:FsShellPermissions.java   
static void changePermissions(FileSystem fs, String cmd, 
                              String argv[], int startIndex, FsShell shell)
                              throws IOException {
  CmdHandler handler = null;
  boolean recursive = false;

  // handle common arguments, currently only "-R" 
  for (; startIndex < argv.length && argv[startIndex].equals("-R"); 
  startIndex++) {
    recursive = true;
  }

  if ( startIndex >= argv.length ) {
    throw new IOException("Not enough arguments for the command");
  }

  if (cmd.equals("-chmod")) {
    handler = new ChmodHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chown")) {
    handler = new ChownHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chgrp")) {
    handler = new ChgrpHandler(fs, argv[startIndex++]);
  }

  shell.runCmdHandler(handler, argv, startIndex, recursive);
}
项目:hadoop-0.20    文件:FsShellPermissions.java   
static void changePermissions(FileSystem fs, String cmd, 
                              String argv[], int startIndex, FsShell shell)
                              throws IOException {
  CmdHandler handler = null;
  boolean recursive = false;

  // handle common arguments, currently only "-R" 
  for (; startIndex < argv.length && argv[startIndex].equals("-R"); 
  startIndex++) {
    recursive = true;
  }

  if ( startIndex >= argv.length ) {
    throw new IOException("Not enough arguments for the command");
  }

  if (cmd.equals("-chmod")) {
    handler = new ChmodHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chown")) {
    handler = new ChownHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chgrp")) {
    handler = new ChgrpHandler(fs, argv[startIndex++]);
  }

  shell.runCmdHandler(handler, argv, startIndex, recursive);
}
项目:hortonworks-extension    文件:FsShellPermissions.java   
static int changePermissions(FileSystem fs, String cmd, 
                              String argv[], int startIndex, FsShell shell)
                              throws IOException {
  CmdHandler handler = null;
  boolean recursive = false;

  // handle common arguments, currently only "-R" 
  for (; startIndex < argv.length && argv[startIndex].equals("-R"); 
  startIndex++) {
    recursive = true;
  }

  if ( startIndex >= argv.length ) {
    throw new IOException("Not enough arguments for the command");
  }

  if (cmd.equals("-chmod")) {
    handler = new ChmodHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chown")) {
    handler = new ChownHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chgrp")) {
    handler = new ChgrpHandler(fs, argv[startIndex++]);
  }

  return shell.runCmdHandler(handler, argv, startIndex, recursive);
}
项目:hortonworks-extension    文件:FsShellPermissions.java   
static int changePermissions(FileSystem fs, String cmd, 
                              String argv[], int startIndex, FsShell shell)
                              throws IOException {
  CmdHandler handler = null;
  boolean recursive = false;

  // handle common arguments, currently only "-R" 
  for (; startIndex < argv.length && argv[startIndex].equals("-R"); 
  startIndex++) {
    recursive = true;
  }

  if ( startIndex >= argv.length ) {
    throw new IOException("Not enough arguments for the command");
  }

  if (cmd.equals("-chmod")) {
    handler = new ChmodHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chown")) {
    handler = new ChownHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chgrp")) {
    handler = new ChgrpHandler(fs, argv[startIndex++]);
  }

  return shell.runCmdHandler(handler, argv, startIndex, recursive);
}
项目:hadoop-gpu    文件:FsShellPermissions.java   
static void changePermissions(FileSystem fs, String cmd, 
                              String argv[], int startIndex, FsShell shell)
                              throws IOException {
  CmdHandler handler = null;
  boolean recursive = false;

  // handle common arguments, currently only "-R" 
  for (; startIndex < argv.length && argv[startIndex].equals("-R"); 
  startIndex++) {
    recursive = true;
  }

  if ( startIndex >= argv.length ) {
    throw new IOException("Not enough arguments for the command");
  }

  if (cmd.equals("-chmod")) {
    handler = new ChmodHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chown")) {
    handler = new ChownHandler(fs, argv[startIndex++]);
  } else if (cmd.equals("-chgrp")) {
    handler = new ChgrpHandler(fs, argv[startIndex++]);
  }

  shell.runCmdHandler(handler, argv, startIndex, recursive);
}