use of org.apache.accumulo.minicluster.MiniAccumuloCluster in project gora by apache.
the class AuthenticationTokenTest method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
cluster = new MiniAccumuloCluster(temporaryFolder.getRoot(), PASSWORD);
cluster.start();
Properties properties = DataStoreFactory.createProps();
properties.setProperty(GORA_DATASTORE + AccumuloStore.MOCK_PROPERTY, "false");
properties.setProperty(GORA_DATASTORE + AccumuloStore.INSTANCE_NAME_PROPERTY, cluster.getInstanceName());
properties.setProperty(GORA_DATASTORE + AccumuloStore.ZOOKEEPERS_NAME_PROPERTY, cluster.getZooKeepers());
properties.setProperty(GORA_DATASTORE + AccumuloStore.PASSWORD_PROPERTY, PASSWORD);
employeeStore = DataStoreFactory.createDataStore(AccumuloStore.class, String.class, Employee.class, new Configuration(), properties);
}
use of org.apache.accumulo.minicluster.MiniAccumuloCluster in project YCSB by brianfrankcooper.
the class AccumuloTest method setup.
@BeforeClass
public static void setup() throws Exception {
// Minicluster setup fails on Windows with an UnsatisfiedLinkError.
// Skip if windows.
assumeTrue(!isWindows());
cluster = new MiniAccumuloCluster(workingDir.newFolder("accumulo").getAbsoluteFile(), "protectyaneck");
LOG.debug("starting minicluster");
cluster.start();
LOG.debug("creating connection for admin operations.");
// set up the table and user
final Connector admin = cluster.getConnector("root", "protectyaneck");
admin.tableOperations().create(CoreWorkload.TABLENAME_PROPERTY_DEFAULT);
admin.securityOperations().createLocalUser("ycsb", new PasswordToken("protectyaneck"));
admin.securityOperations().grantTablePermission("ycsb", CoreWorkload.TABLENAME_PROPERTY_DEFAULT, TablePermission.READ);
admin.securityOperations().grantTablePermission("ycsb", CoreWorkload.TABLENAME_PROPERTY_DEFAULT, TablePermission.WRITE);
// set properties the binding will read
properties = new Properties();
properties.setProperty("accumulo.zooKeepers", cluster.getZooKeepers());
properties.setProperty("accumulo.instanceName", cluster.getInstanceName());
properties.setProperty("accumulo.columnFamily", "family");
properties.setProperty("accumulo.username", "ycsb");
properties.setProperty("accumulo.password", "protectyaneck");
// cut down the batch writer timeout so that writes will push through.
properties.setProperty("accumulo.batchWriterMaxLatency", "4");
// set these explicitly to the defaults at the time we're compiled, since they'll be inlined in our class.
properties.setProperty(CoreWorkload.TABLENAME_PROPERTY, CoreWorkload.TABLENAME_PROPERTY_DEFAULT);
properties.setProperty(CoreWorkload.FIELD_COUNT_PROPERTY, CoreWorkload.FIELD_COUNT_PROPERTY_DEFAULT);
properties.setProperty(CoreWorkload.INSERT_ORDER_PROPERTY, "ordered");
}
Aggregations