Example usage for org.apache.hadoop.filecache DistributedCache setLocalArchives

List of usage examples for org.apache.hadoop.filecache DistributedCache setLocalArchives

Introduction

In this page you can find the example usage for org.apache.hadoop.filecache DistributedCache setLocalArchives.

Prototype

@Deprecated
public static void setLocalArchives(Configuration conf, String str) 

Source Link

Document

Set the conf to contain the location for localized archives.

Usage

From source file:io.apigee.lembos.node.types.DistributedCacheWrap.java

License:Apache License

/**
 * Java wrapper for {@link DistributedCache#setLocalArchives(Configuration, String)}.
 *
 * @param ctx the JavaScript context/*from   ww w .  j  a v a  2s.co  m*/
 * @param thisObj the 'this' object
 * @param args the function arguments
 * @param func the function being called
 */
@JSStaticFunction
public static void setLocalArchives(final Context ctx, final Scriptable thisObj, final Object[] args,
        final Function func) {
    final Object arg0 = args.length >= 1 ? args[0] : Undefined.instance;
    final Object arg1 = args.length >= 2 ? args[1] : Undefined.instance;

    if (args.length < 2) {
        throw Utils.makeError(ctx, thisObj, LembosMessages.TWO_ARGS_EXPECTED);
    } else if (!JavaScriptUtils.isDefined(arg0)) {
        throw Utils.makeError(ctx, thisObj, LembosMessages.FIRST_ARG_REQUIRED);
    } else if (!JavaScriptUtils.isDefined(arg1)) {
        throw Utils.makeError(ctx, thisObj, LembosMessages.SECOND_ARG_REQUIRED);
    } else if (!(arg0 instanceof ConfigurationWrap)) {
        throw Utils.makeError(ctx, thisObj, LembosMessages.FIRST_ARG_MUST_BE_CONF);
    }

    DistributedCache.setLocalArchives(((ConfigurationWrap) arg0).getConf(), arg1.toString());
}