This project has retired. For details please refer to its Attic page.
Source code
001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.reef.runtime.hdinsight;
020
021import net.jcip.annotations.Immutable;
022import org.apache.reef.runtime.common.files.RuntimeClasspathProvider;
023
024import javax.inject.Inject;
025import java.util.Arrays;
026import java.util.Collections;
027import java.util.List;
028
029/**
030 * Access to the classpath according to the REEF file system standard.
031 */
032@Immutable
033public final class HDInsightClasspathProvider implements RuntimeClasspathProvider {
034
035  private static final List<String> CLASSPATH_PREFIX = Collections
036      .unmodifiableList(Arrays.asList("%HADOOP_HOME%/etc/hadoop"));
037
038  private static final List<String> CLASSPATH_SUFFIX = Collections.unmodifiableList(
039      Arrays.asList(
040          "%HADOOP_HOME%/share/hadoop/common/*",
041          "%HADOOP_HOME%/share/hadoop/common/lib/*",
042          "%HADOOP_HOME%/share/hadoop/yarn/*",
043          "%HADOOP_HOME%/share/hadoop/yarn/lib/*",
044          "%HADOOP_HOME%/share/hadoop/hdfs/*",
045          "%HADOOP_HOME%/share/hadoop/hdfs/lib/*",
046          "%HADOOP_HOME%/share/hadoop/mapreduce/*",
047          "%HADOOP_HOME%/share/hadoop/mapreduce/lib/*")
048  );
049
050  @Inject
051  HDInsightClasspathProvider() {
052  }
053
054  @Override
055  public List<String> getDriverClasspathPrefix() {
056    return CLASSPATH_PREFIX;
057  }
058
059  @Override
060  public List<String> getDriverClasspathSuffix() {
061    return CLASSPATH_SUFFIX;
062  }
063
064  @Override
065  public List<String> getEvaluatorClasspathPrefix() {
066    return CLASSPATH_PREFIX;
067  }
068
069  @Override
070  public List<String> getEvaluatorClasspathSuffix() {
071    return CLASSPATH_SUFFIX;
072  }
073}