All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.twill.internal.yarn.YarnLocalResource Maven / Gradle / Ivy

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.twill.internal.yarn;

import org.apache.hadoop.yarn.api.records.LocalResourceType;
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
import org.apache.hadoop.yarn.api.records.URL;

/**
 * A adapter interface for the LocalResource class/interface in different Hadoop version.
 */
public interface YarnLocalResource {

  /**
   * Returns the actual LocalResource object in Yarn.
   */
   T getLocalResource();

  /**
   * Get the location of the resource to be localized.
   * @return location of the resource to be localized
   */
  URL getResource();

  /**
   * Set location of the resource to be localized.
   * @param resource location of the resource to be localized
   */
  void setResource(URL resource);

  /**
   * Get the size of the resource to be localized.
   * @return size of the resource to be localized
   */
  long getSize();

  /**
   * Set the size of the resource to be localized.
   * @param size size of the resource to be localized
   */
  void setSize(long size);

  /**
   * Get the original timestamp of the resource to be localized, used
   * for verification.
   * @return timestamp of the resource to be localized
   */
  long getTimestamp();

  /**
   * Set the timestamp of the resource to be localized, used
   * for verification.
   * @param timestamp timestamp of the resource to be localized
   */
  void setTimestamp(long timestamp);

  /**
   * Get the LocalResourceType of the resource to be localized.
   * @return LocalResourceType of the resource to be localized
   */
  LocalResourceType getType();

  /**
   * Set the LocalResourceType of the resource to be localized.
   * @param type LocalResourceType of the resource to be localized
   */
  void setType(LocalResourceType type);

  /**
   * Get the LocalResourceVisibility of the resource to be
   * localized.
   * @return LocalResourceVisibility of the resource to be
   *         localized
   */
  LocalResourceVisibility getVisibility();

  /**
   * Set the LocalResourceVisibility of the resource to be
   * localized.
   * @param visibility LocalResourceVisibility of the resource to be
   *                   localized
   */
  void setVisibility(LocalResourceVisibility visibility);

  /**
   * Get the pattern that should be used to extract entries from the
   * archive (only used when type is PATTERN).
   * @return pattern that should be used to extract entries from the
   * archive.
   */
  String getPattern();

  /**
   * Set the pattern that should be used to extract entries from the
   * archive (only used when type is PATTERN).
   * @param pattern pattern that should be used to extract entries
   * from the archive.
   */
  void setPattern(String pattern);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy