Ejemplo n.º 1
0
 /**
  * インスタンスを生成する。
  *
  * @param configuration 設定情報
  * @throws IOException ファイルシステムの利用に失敗した場合
  * @throws IllegalArgumentException 引数に{@code null}が含まれる場合
  */
 public StageResourceDriver(Configuration configuration) throws IOException {
   if (configuration == null) {
     throw new IllegalArgumentException("configuration must not be null"); // $NON-NLS-1$
   }
   this.configuration = configuration;
   this.localFileSystem = FileSystem.getLocal(configuration);
   this.accessMode = AccessMode.decode(configuration.get(KEY_ACCESS_MODE));
 }
Ejemplo n.º 2
0
 /**
  * Returns the access mode for stage resources in the job.
  *
  * @param context the current job context
  * @return the access mode
  * @since 0.7.1
  */
 public static AccessMode getAccessMode(JobContext context) {
   if (context == null) {
     throw new IllegalArgumentException("context must not be null"); // $NON-NLS-1$
   }
   return AccessMode.decode(context.getConfiguration().get(KEY_ACCESS_MODE));
 }