Java Code Examples for org.apache.pig.impl.util.Utils#isVendorIBM()

The following examples show how to use org.apache.pig.impl.util.Utils#isVendorIBM() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StoreFuncWrapper.java    From spork with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a method in the call stack at the given depth. Depth 0 will return the method that
 * called this getMethodName, depth 1 the method that called it, etc...
 * @param depth
 * @return method name as String
 */
protected String getMethodName(final int depth) {
    final StackTraceElement[] ste = Thread.currentThread().getStackTrace();
    int index;
    if (Utils.isVendorIBM()) {
      index = 3 + depth;
    } else {
      index = 2 + depth;
    }
    return ste[index].getMethodName();
}
 
Example 2
Source File: LoadFuncWrapper.java    From spork with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a method in the call stack at the given depth. Depth 0 will return the method that
 * called this getMethodName, depth 1 the method that called it, etc...
 * @param depth
 * @return method name as String
 */
protected String getMethodName(final int depth) {
    final StackTraceElement[] ste = Thread.currentThread().getStackTrace();
    int index;
    if (Utils.isVendorIBM()) {
      index = 3 + depth;
    } else {
      index = 2 + depth;
    }
    return ste[index].getMethodName();
}
 
Example 3
Source File: TestLoadFuncWrapper.java    From spork with Apache License 2.0 5 votes vote down vote up
protected void setLastMethodCalled() {
	StackTraceElement e[] = Thread.currentThread().getStackTrace();            
    int index;
    if (Utils.isVendorIBM()) {
      index = 3;
    } else {
      index = 2;
    }
    methodCalls.push(e[index].getMethodName());
}
 
Example 4
Source File: TestAvroStorage.java    From spork with Apache License 2.0 5 votes vote down vote up
private String createOutputName() {
    final StackTraceElement[] st = Thread.currentThread().getStackTrace();
    if(Util.WINDOWS){
        outbasedir = outbasedir.replace('\\','/');
    }

    int index;
    if (Utils.isVendorIBM()) {
        index = 3;
    } else {
        index = 2;
    }

    return outbasedir + st[index].getMethodName();
}
 
Example 5
Source File: TestStoreFuncWrapper.java    From spork with Apache License 2.0 5 votes vote down vote up
protected void setLastMethodCalled() {            
    StackTraceElement e[] = Thread.currentThread().getStackTrace();                   
    int index;
    if (Utils.isVendorIBM()) {
      index = 3;
    } else {
      index = 2;
    }
    methodCalls.push(e[index].getMethodName());
}