Example usage for org.apache.hadoop.conf Configuration setInt

List of usage examples for org.apache.hadoop.conf Configuration setInt

Introduction

In this page you can find the example usage for org.apache.hadoop.conf Configuration setInt.

Prototype

public void setInt(String name, int value) 

Source Link

Document

Set the value of the name property to an int.

Usage

From source file:com.cloudera.knittingboar.sgd.TestBaseSGD.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 20);

    c.setInt("com.cloudera.knittingboar.setup.numCategories", 2);

    c.setInt("com.cloudera.knittingboar.setup.BatchSize", 10);

    c.set("com.cloudera.knittingboar.setup.RecordFactoryClassname", RecordFactory.CSV_RECORDFACTORY);

    // local input split path
    c.set("com.cloudera.knittingboar.setup.LocalInputSplitPath", "hdfs://127.0.0.1/input/0");

    // predictor label names
    c.set("com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y");

    // predictor var types
    c.set("com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric");

    // target variables
    c.set("com.cloudera.knittingboar.setup.TargetVariableName", "color");

    // column header names
    c.set("com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias");
    //c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "\"x\",\"y\",\"shape\",\"color\",\"k\",\"k0\",\"xx\",\"xy\",\"yy\",\"a\",\"b\",\"c\",\"bias\"\n" );

    return c;//ww  w  .  j a  va2 s  .c om

}

From source file:com.cloudera.knittingboar.sgd.TestPOLRMasterDriver.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 10);

    // local input split path
    c.set("com.cloudera.knittingboar.setup.LocalInputSplitPath", "hdfs://127.0.0.1/input/0");

    // predictor label names
    c.set("com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y");

    // predictor var types
    c.set("com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric");

    // target variables
    c.set("com.cloudera.knittingboar.setup.TargetVariableName", "color");

    // column header names
    c.set("com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias");

    return c;/*w w w.  j a va  2s .co m*/

}

From source file:com.cloudera.knittingboar.sgd.TestPOLRMasterNode.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 10);

    c.set("com.cloudera.knittingboar.setup.RecordFactoryClassname", RecordFactory.CSV_RECORDFACTORY);

    // predictor label names
    c.set("com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y");

    // predictor var types
    c.set("com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric");

    // target variables
    c.set("com.cloudera.knittingboar.setup.TargetVariableName", "color");

    // column header names
    c.set("com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias");

    return c;/*from  w w w  . j  a  v a 2s  . c o  m*/

}

From source file:com.cloudera.knittingboar.sgd.TestPOLRWorkerDriver.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 10);

    c.setInt("com.cloudera.knittingboar.setup.numCategories", 2);

    c.setInt("com.cloudera.knittingboar.setup.BatchSize", 10);

    c.set("com.cloudera.knittingboar.setup.RecordFactoryClassname", RecordFactory.CSV_RECORDFACTORY);

    // local input split path
    c.set("com.cloudera.knittingboar.setup.LocalInputSplitPath", "hdfs://127.0.0.1/input/0");

    // predictor label names
    c.set("com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y");

    // predictor var types
    c.set("com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric");

    // target variables
    c.set("com.cloudera.knittingboar.setup.TargetVariableName", "color");

    // column header names
    c.set("com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias");
    //c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "\"x\",\"y\",\"shape\",\"color\",\"k\",\"k0\",\"xx\",\"xy\",\"yy\",\"a\",\"b\",\"c\",\"bias\"\n" );

    return c;//from  w w w  . ja  v  a 2 s .c  o m

}

From source file:com.cloudera.knittingboar.sgd.TestPOLRWorkerNode.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 10);

    c.setInt("com.cloudera.knittingboar.setup.numCategories", 2);

    c.set("com.cloudera.knittingboar.setup.RecordFactoryClassname", RecordFactory.CSV_RECORDFACTORY);

    // local input split path
    //    c.set( "com.cloudera.knittingboar.setup.LocalInputSplitPath", "hdfs://127.0.0.1/input/0" );

    // predictor label names
    c.set("com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y");

    // predictor var types
    c.set("com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric");

    // target variables
    c.set("com.cloudera.knittingboar.setup.TargetVariableName", "color");

    // column header names
    c.set("com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias");
    //c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "\"x\",\"y\",\"shape\",\"color\",\"k\",\"k0\",\"xx\",\"xy\",\"yy\",\"a\",\"b\",\"c\",\"bias\"\n" );

    return c;//w w  w . j  a  v a2 s . c om

}

From source file:com.cloudera.knittingboar.sgd.TestRunPOLRMasterAndNWorkers.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 10000);

    c.setInt("com.cloudera.knittingboar.setup.numCategories", 20);

    c.setInt("com.cloudera.knittingboar.setup.BatchSize", 500);

    c.setInt("com.cloudera.knittingboar.setup.NumberPasses", 1);

    // local input split path
    c.set("com.cloudera.knittingboar.setup.LocalInputSplitPath", "hdfs://127.0.0.1/input/0");

    // setup 20newsgroups
    c.set("com.cloudera.knittingboar.setup.RecordFactoryClassname",
            "com.cloudera.knittingboar.records.TwentyNewsgroupsRecordFactory");

    /*    // predictor label names
        c.set( "com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y" );
            //from ww w  . j  a  v  a2s.  c  o  m
        // predictor var types
        c.set( "com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric" );
                
        // target variables
        c.set( "com.cloudera.knittingboar.setup.TargetVariableName", "color" );
            
        // column header names
        c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias" );
        //c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "\"x\",\"y\",\"shape\",\"color\",\"k\",\"k0\",\"xx\",\"xy\",\"yy\",\"a\",\"b\",\"c\",\"bias\"\n" );
     */
    return c;

}

From source file:com.cloudera.knittingboar.sgd.TestRunPOLRWorkerSingleBatch.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 10000);

    c.setInt("com.cloudera.knittingboar.setup.numCategories", 20);

    // local input split path
    c.set("com.cloudera.knittingboar.setup.LocalInputSplitPath", "hdfs://127.0.0.1/input/0");

    c.set("com.cloudera.knittingboar.setup.RecordFactoryClassname",
            "com.cloudera.knittingboar.records.TwentyNewsgroupsRecordFactory");

    /*    // predictor label names
        c.set( "com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y" );
            /*from  w  ww . j a v a  2s. co  m*/
        // predictor var types
        c.set( "com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric" );
                
        // target variables
        c.set( "com.cloudera.knittingboar.setup.TargetVariableName", "color" );
            
        // column header names
        c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias" );
        //c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "\"x\",\"y\",\"shape\",\"color\",\"k\",\"k0\",\"xx\",\"xy\",\"yy\",\"a\",\"b\",\"c\",\"bias\"\n" );
     */
    return c;

}

From source file:com.cloudera.knittingboar.sgd.TestRunRCV1Subset.java

License:Apache License

public Configuration generateDebugConfigurationObject() {

    Configuration c = new Configuration();

    // feature vector size
    c.setInt("com.cloudera.knittingboar.setup.FeatureVectorSize", 10000);

    c.setInt("com.cloudera.knittingboar.setup.numCategories", 2);

    c.setInt("com.cloudera.knittingboar.setup.BatchSize", 200);

    // local input split path
    c.set("com.cloudera.knittingboar.setup.LocalInputSplitPath", "hdfs://127.0.0.1/input/0");

    // setup 20newsgroups
    c.set("com.cloudera.knittingboar.setup.RecordFactoryClassname", RecordFactory.RCV1_RECORDFACTORY);

    /*    // predictor label names
        c.set( "com.cloudera.knittingboar.setup.PredictorLabelNames", "x,y" );
            //from  w  w  w  .j  a v a2  s  . c o m
        // predictor var types
        c.set( "com.cloudera.knittingboar.setup.PredictorVariableTypes", "numeric,numeric" );
                
        // target variables
        c.set( "com.cloudera.knittingboar.setup.TargetVariableName", "color" );
            
        // column header names
        c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "x,y,shape,color,k,k0,xx,xy,yy,a,b,c,bias" );
        //c.set( "com.cloudera.knittingboar.setup.ColumnHeaderNames", "\"x\",\"y\",\"shape\",\"color\",\"k\",\"k0\",\"xx\",\"xy\",\"yy\",\"a\",\"b\",\"c\",\"bias\"\n" );
     */
    return c;

}

From source file:com.cloudera.llama.am.impl.TestNormalizerRMConnector.java

License:Apache License

@Before
public void setUp() {
    connector = new RecordingMockRMConnector();
    Configuration conf = new Configuration();
    conf.setInt(LlamaAM.NORMALIZING_STANDARD_MBS_KEY, 512);
    conf.setInt(LlamaAM.NORMALIZING_STANDARD_VCORES_KEY, 2);
    normalizer = new NormalizerRMConnector(conf, connector);
    listener = new CallbackStorer();
    normalizer.setRMListener(listener);//from ww  w.  j ava2 s .  co m
}

From source file:com.cloudera.llama.am.impl.TestThrottleLlamaAM.java

License:Apache License

@Test
public void testStartStopConfigs() throws Exception {
    SingleQueueLlamaAM am = Mockito.mock(SingleQueueLlamaAM.class);

    //config defaults

    Configuration conf = new Configuration(false);
    ThrottleLlamaAM tAm = new ThrottleLlamaAM(conf, "q", am);
    tAm.setMetricRegistry(new MetricRegistry());
    try {/*from w  w  w. j av  a  2 s.  c  om*/
        tAm.start();
        Mockito.verify(am).start();
        Assert.assertEquals(ThrottleLlamaAM.MAX_PLACED_RESERVATIONS_DEFAULT, tAm.getMaxPlacedReservations());
        Assert.assertEquals(ThrottleLlamaAM.MAX_QUEUED_RESERVATIONS_DEFAULT, tAm.getMaxQueuedReservations());
    } finally {
        tAm.stop();
        Mockito.verify(am).stop();
    }

    //custom global

    conf.setInt(ThrottleLlamaAM.MAX_PLACED_RESERVATIONS_KEY,
            ThrottleLlamaAM.MAX_PLACED_RESERVATIONS_DEFAULT + 1);
    conf.setInt(ThrottleLlamaAM.MAX_QUEUED_RESERVATIONS_KEY,
            ThrottleLlamaAM.MAX_QUEUED_RESERVATIONS_DEFAULT + 2);
    tAm = new ThrottleLlamaAM(conf, "q", am);
    try {
        tAm.start();
        Assert.assertEquals(ThrottleLlamaAM.MAX_PLACED_RESERVATIONS_DEFAULT + 1,
                tAm.getMaxPlacedReservations());
        Assert.assertEquals(ThrottleLlamaAM.MAX_QUEUED_RESERVATIONS_DEFAULT + 2,
                tAm.getMaxQueuedReservations());

    } finally {
        tAm.stop();
    }

    //custom queue

    conf.setInt(FastFormat.format(ThrottleLlamaAM.MAX_PLACED_RESERVATIONS_QUEUE_KEY, "q"), 1);
    conf.setInt(FastFormat.format(ThrottleLlamaAM.MAX_QUEUED_RESERVATIONS_QUEUE_KEY, "q"), 2);
    tAm = new ThrottleLlamaAM(conf, "q", am);
    try {
        tAm.start();
        Assert.assertEquals(1, tAm.getMaxPlacedReservations());
        Assert.assertEquals(2, tAm.getMaxQueuedReservations());

    } finally {
        tAm.stop();
    }
}