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

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

Introduction

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

Prototype

@Deprecated
public static void setFileTimestamps(Configuration conf, String timestamps) 

Source Link

Document

This is to check the timestamp of the files to be localized.

Usage

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

License:Apache License

/**
 * Java wrapper for {@link DistributedCache#setFileTimestamps(Configuration, String)}.
 *
 * @param ctx the JavaScript context//from   w w  w  .  j a  va2s .c  o m
 * @param thisObj the 'this' object
 * @param args the function arguments
 * @param func the function being called
 */
@JSStaticFunction
public static void setFileTimestamps(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.setFileTimestamps(((ConfigurationWrap) arg0).getConf(), arg1.toString());
}