Search in sources :

Example 36 with MiniAccumuloCluster

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);
}
Also used : Employee(org.apache.gora.examples.generated.Employee) Configuration(org.apache.hadoop.conf.Configuration) MiniAccumuloCluster(org.apache.accumulo.minicluster.MiniAccumuloCluster) Properties(java.util.Properties) Before(org.junit.Before)

Example 37 with MiniAccumuloCluster

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");
}
Also used : Connector(org.apache.accumulo.core.client.Connector) PasswordToken(org.apache.accumulo.core.client.security.tokens.PasswordToken) MiniAccumuloCluster(org.apache.accumulo.minicluster.MiniAccumuloCluster) Properties(java.util.Properties) BeforeClass(org.junit.BeforeClass)

Aggregations

MiniAccumuloCluster (org.apache.accumulo.minicluster.MiniAccumuloCluster)37 File (java.io.File)11 PasswordToken (org.apache.accumulo.core.client.security.tokens.PasswordToken)8 MiniAccumuloConfig (org.apache.accumulo.minicluster.MiniAccumuloConfig)8 Test (org.junit.Test)7 IOException (java.io.IOException)6 Connector (org.apache.accumulo.core.client.Connector)6 PasswordPrompt (org.apache.rya.shell.util.PasswordPrompt)6 RFileReaderRDD (uk.gov.gchq.gaffer.sparkaccumulo.operation.rfilereaderrdd.RFileReaderRDD)6 ZooKeeperInstance (org.apache.accumulo.core.client.ZooKeeperInstance)5 Test (org.junit.jupiter.api.Test)5 ApplicationContext (org.springframework.context.ApplicationContext)5 Bootstrap (org.springframework.shell.Bootstrap)5 CommandResult (org.springframework.shell.core.CommandResult)5 JLineShellComponent (org.springframework.shell.core.JLineShellComponent)5 Properties (java.util.Properties)4 BeforeClass (org.junit.BeforeClass)4 AccumuloException (org.apache.accumulo.core.client.AccumuloException)3 Instance (org.apache.accumulo.core.client.Instance)3 RyaClient (org.apache.rya.api.client.RyaClient)3