public void setLocation(String location, Job job) throws IOException
    {
        conf = HadoopCompat.getConfiguration(job);
        setLocationFromUri(location);

        if (ConfigHelper.getInputSlicePredicate(conf) == null)
        {
            SliceRange range = new SliceRange(slice_start, slice_end, slice_reverse, limit);
            SlicePredicate predicate = new SlicePredicate().setSlice_range(range);
            ConfigHelper.setInputSlicePredicate(conf, predicate);
        }
        if (System.getenv(PIG_WIDEROW_INPUT) != null)
            widerows = Boolean.parseBoolean(System.getenv(PIG_WIDEROW_INPUT));
        if (System.getenv(PIG_USE_SECONDARY) != null)
            usePartitionFilter = Boolean.parseBoolean(System.getenv(PIG_USE_SECONDARY));
        if (System.getenv(PIG_INPUT_SPLIT_SIZE) != null)
        {
            try
            {
                ConfigHelper.setInputSplitSize(conf, Integer.parseInt(System.getenv(PIG_INPUT_SPLIT_SIZE)));
            }
            catch (NumberFormatException e)
            {
                throw new IOException("PIG_INPUT_SPLIT_SIZE is not a number", e);
            }           
        } 

        if (usePartitionFilter && getIndexExpressions() != null)
            ConfigHelper.setInputRange(conf, getIndexExpressions());

        if (username != null && password != null)
            ConfigHelper.setInputKeyspaceUserNameAndPassword(conf, username, password);

        if (splitSize > 0)
            ConfigHelper.setInputSplitSize(conf, splitSize);
        if (partitionerClass!= null)
            ConfigHelper.setInputPartitioner(conf, partitionerClass);
        if (rpcPort != null)
            ConfigHelper.setInputRpcPort(conf, rpcPort);
        if (initHostAddress != null)
            ConfigHelper.setInputInitialAddress(conf, initHostAddress);

        ConfigHelper.setInputColumnFamily(conf, keyspace, column_family, widerows);
        setConnectionInformation();

        if (ConfigHelper.getInputRpcPort(conf) == 0)
            throw new IOException("PIG_INPUT_RPC_PORT or PIG_RPC_PORT environment variable not set");
        if (ConfigHelper.getInputInitialAddress(conf) == null)
            throw new IOException("PIG_INPUT_INITIAL_ADDRESS or PIG_INITIAL_ADDRESS environment variable not set");
        if (ConfigHelper.getInputPartitioner(conf) == null)
            throw new IOException("PIG_INPUT_PARTITIONER or PIG_PARTITIONER environment variable not set");
        if (loadSignature == null)
            loadSignature = location;
        initSchema(loadSignature);
    }
public void setLocation ( String location , Job job ) throws IOException { conf = HadoopCompat . getConfiguration ( job ) ; setLocationFromUri ( location ) ; if ( ConfigHelper . getInputSlicePredicate ( conf ) == null ) { SliceRange range = new SliceRange ( slice_start , slice_end , slice_reverse , limit ) ; SlicePredicate predicate = new SlicePredicate ( ) . setSlice_range ( range ) ; ConfigHelper . setInputSlicePredicate ( conf , predicate ) ; } if ( System . getenv ( PIG_WIDEROW_INPUT ) != null ) widerows = Boolean . parseBoolean ( System . getenv ( PIG_WIDEROW_INPUT ) ) ; if ( System . getenv ( PIG_USE_SECONDARY ) != null ) usePartitionFilter = Boolean . parseBoolean ( System . getenv ( PIG_USE_SECONDARY ) ) ; if ( System . getenv ( PIG_INPUT_SPLIT_SIZE ) != null ) { try { ConfigHelper . setInputSplitSize ( conf , Integer . parseInt ( System . getenv ( PIG_INPUT_SPLIT_SIZE ) ) ) ; } catch ( NumberFormatException e ) { throw new IOException ( "PIG_INPUT_SPLIT_SIZE is not a number" , e ) ; } } if ( usePartitionFilter && getIndexExpressions ( ) != null ) ConfigHelper . setInputRange ( conf , getIndexExpressions ( ) ) ; if ( username != null && password != null ) ConfigHelper . setInputKeyspaceUserNameAndPassword ( conf , username , password ) ; if ( splitSize > 0 ) ConfigHelper . setInputSplitSize ( conf , splitSize ) ; if ( partitionerClass != null ) ConfigHelper . setInputPartitioner ( conf , partitionerClass ) ; if ( rpcPort != null ) ConfigHelper . setInputRpcPort ( conf , rpcPort ) ; if ( initHostAddress != null ) ConfigHelper . setInputInitialAddress ( conf , initHostAddress ) ; ConfigHelper . setInputColumnFamily ( conf , keyspace , column_family , widerows ) ; setConnectionInformation ( ) ; if ( ConfigHelper . getInputRpcPort ( conf ) == 0 ) throw new IOException ( "PIG_INPUT_RPC_PORT or PIG_RPC_PORT environment variable not set" ) ; if ( ConfigHelper . getInputInitialAddress ( conf ) == null ) throw new IOException ( "PIG_INPUT_INITIAL_ADDRESS or PIG_INITIAL_ADDRESS environment variable not set" ) ; if ( ConfigHelper . getInputPartitioner ( conf ) == null ) throw new IOException ( "PIG_INPUT_PARTITIONER or PIG_PARTITIONER environment variable not set" ) ; if ( loadSignature == null ) loadSignature = location ; initSchema ( loadSignature ) ; }
set read configuration settings