Search in sources :

Example 1 with CoreWorkload

use of site.ycsb.workloads.CoreWorkload in project YCSB by brianfrankcooper.

the class ScyllaCQLClientTest method setUp.

@Before
public void setUp() throws Exception {
    session = unit.getSession();
    Properties p = new Properties();
    p.setProperty("scylla.hosts", HOST);
    p.setProperty("scylla.port", Integer.toString(PORT));
    p.setProperty("scylla.table", TABLE);
    Measurements.setProperties(p);
    final CoreWorkload workload = new CoreWorkload();
    workload.init(p);
    client = new ScyllaCQLClient();
    client.setProperties(p);
    client.init();
}
Also used : CoreWorkload(site.ycsb.workloads.CoreWorkload) Properties(java.util.Properties) Before(org.junit.Before)

Example 2 with CoreWorkload

use of site.ycsb.workloads.CoreWorkload in project YCSB by brianfrankcooper.

the class GridDBClientTest method setUp.

/**
 * Create properties for configuration to get client
 * Create data table to test
 */
@Before
public void setUp() throws Exception {
    Properties p = new Properties();
    p.setProperty("notificationAddress", NOTIFICATION_ADDR);
    p.setProperty("notificationPort", NOTIFICATION_PORT);
    p.setProperty("clusterName", CLUSTER_NAME);
    p.setProperty("userName", USER_NAME);
    p.setProperty("user", USER_NAME);
    p.setProperty("password", PASS);
    p.setProperty("fieldcount", String.valueOf(FIELD_COUNT));
    p.setProperty("fieldlength", FIELD_LENGTH);
    Measurements.setProperties(p);
    final CoreWorkload workload = new CoreWorkload();
    workload.init(p);
    getDB(p);
    // Create data table to test
    // List of columns
    List<ColumnInfo> columnInfoList = new ArrayList<ColumnInfo>();
    ColumnInfo keyInfo = new ColumnInfo("key", GSType.STRING);
    columnInfoList.add(keyInfo);
    for (int i = 0; i < FIELD_COUNT; i++) {
        String columnName = String.format(VALUE_COLUMN_NAME_PREFIX + "%d", i);
        ColumnInfo info = new ColumnInfo(columnName, GSType.STRING);
        columnInfoList.add(info);
    }
    containerInfo = new ContainerInfo(null, ContainerType.COLLECTION, columnInfoList, true);
    try {
        GridStoreFactory.getInstance().setProperties(p);
        store = GridStoreFactory.getInstance().getGridStore(p);
        store.putContainer(TEST_TABLE, containerInfo, false);
    } catch (GSException e) {
        e.printStackTrace();
        throw new DBException();
    }
}
Also used : DBException(site.ycsb.DBException) CoreWorkload(site.ycsb.workloads.CoreWorkload) ArrayList(java.util.ArrayList) ContainerInfo(com.toshiba.mwcloud.gs.ContainerInfo) ColumnInfo(com.toshiba.mwcloud.gs.ColumnInfo) Properties(java.util.Properties) GSException(com.toshiba.mwcloud.gs.GSException) Before(org.junit.Before)

Example 3 with CoreWorkload

use of site.ycsb.workloads.CoreWorkload in project YCSB by brianfrankcooper.

the class AsyncHBaseTest method setUp.

/**
 * Sets up the mini-cluster for testing.
 *
 * We re-create the table for each test.
 */
@Before
public void setUp() throws Exception {
    Properties p = new Properties();
    p.setProperty("columnfamily", COLUMN_FAMILY);
    Measurements.setProperties(p);
    final CoreWorkload workload = new CoreWorkload();
    workload.init(p);
    tableName = p.getProperty(TABLENAME_PROPERTY, TABLENAME_PROPERTY_DEFAULT);
    table = testingUtil.createTable(TableName.valueOf(tableName), Bytes.toBytes(COLUMN_FAMILY));
    final String zkQuorum = "127.0.0.1:" + testingUtil.getZkCluster().getClientPort();
    p.setProperty("hbase.zookeeper.quorum", zkQuorum);
    client = new AsyncHBaseClient();
    client.setProperties(p);
    client.init();
}
Also used : CoreWorkload(site.ycsb.workloads.CoreWorkload) Properties(java.util.Properties) Before(org.junit.Before)

Example 4 with CoreWorkload

use of site.ycsb.workloads.CoreWorkload in project YCSB by brianfrankcooper.

the class CassandraCQLClientTest method setUp.

@Before
public void setUp() throws Exception {
    session = cassandraUnit.getSession();
    Properties p = new Properties();
    p.setProperty("hosts", HOST);
    p.setProperty("port", Integer.toString(PORT));
    p.setProperty("table", TABLE);
    Measurements.setProperties(p);
    final CoreWorkload workload = new CoreWorkload();
    workload.init(p);
    client = new CassandraCQLClient();
    client.setProperties(p);
    client.init();
}
Also used : CoreWorkload(site.ycsb.workloads.CoreWorkload) Properties(java.util.Properties) Before(org.junit.Before)

Example 5 with CoreWorkload

use of site.ycsb.workloads.CoreWorkload in project YCSB by brianfrankcooper.

the class AccumuloTest method client.

@Before
public void client() throws Exception {
    LOG.debug("Loading workload properties for {}", test.getMethodName());
    workloadProps = new Properties();
    workloadProps.load(getClass().getResourceAsStream("/workloads/" + test.getMethodName()));
    for (String prop : properties.stringPropertyNames()) {
        workloadProps.setProperty(prop, properties.getProperty(prop));
    }
    // TODO we need a better test rig for 'run this ycsb workload'
    LOG.debug("initializing measurements and workload");
    Measurements.setProperties(workloadProps);
    workload = new CoreWorkload();
    workload.init(workloadProps);
    LOG.debug("initializing client");
    client = new AccumuloClient();
    client.setProperties(workloadProps);
    client.init();
}
Also used : CoreWorkload(site.ycsb.workloads.CoreWorkload) Properties(java.util.Properties) Before(org.junit.Before)

Aggregations

CoreWorkload (site.ycsb.workloads.CoreWorkload)8 Properties (java.util.Properties)7 Before (org.junit.Before)7 Configuration (org.apache.hadoop.conf.Configuration)2 ColumnInfo (com.toshiba.mwcloud.gs.ColumnInfo)1 ContainerInfo (com.toshiba.mwcloud.gs.ContainerInfo)1 GSException (com.toshiba.mwcloud.gs.GSException)1 ArrayList (java.util.ArrayList)1 DBException (site.ycsb.DBException)1