Search in sources :

Example 1 with MockDataStore

use of org.apache.gora.mock.store.MockDataStore in project gora by apache.

the class TestGoraInputFormat method getInputSplits.

public List<InputSplit> getInputSplits() throws IOException, InterruptedException {
    Job job = Job.getInstance(new Configuration());
    MockDataStore store = MockDataStore.get();
    MockQuery query = store.newQuery();
    query.setFields(getEmployeeFieldNames());
    GoraInputFormat.setInput(job, query, false);
    GoraInputFormat<String, MockPersistent> inputFormat = new GoraInputFormat<>();
    inputFormat.setConf(job.getConfiguration());
    return inputFormat.getSplits(job);
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) Job(org.apache.hadoop.mapreduce.Job) MockQuery(org.apache.gora.mock.query.MockQuery) MockPersistent(org.apache.gora.mock.persistency.MockPersistent) MockDataStore(org.apache.gora.mock.store.MockDataStore)

Example 2 with MockDataStore

use of org.apache.gora.mock.store.MockDataStore in project gora by apache.

the class TestGoraInputSplit method getPartitions.

private List<PartitionQuery<String, MockPersistent>> getPartitions() throws IOException {
    MockDataStore store = MockDataStore.get();
    MockQuery query = store.newQuery();
    List<PartitionQuery<String, MockPersistent>> partitions = store.getPartitions(query);
    return partitions;
}
Also used : MockQuery(org.apache.gora.mock.query.MockQuery) PartitionQuery(org.apache.gora.query.PartitionQuery) MockDataStore(org.apache.gora.mock.store.MockDataStore)

Aggregations

MockQuery (org.apache.gora.mock.query.MockQuery)2 MockDataStore (org.apache.gora.mock.store.MockDataStore)2 MockPersistent (org.apache.gora.mock.persistency.MockPersistent)1 PartitionQuery (org.apache.gora.query.PartitionQuery)1 Configuration (org.apache.hadoop.conf.Configuration)1 Job (org.apache.hadoop.mapreduce.Job)1