use of org.apache.accumulo.tserver.InMemoryMap.MemoryIterator in project accumulo by apache.
the class InMemoryMapTest method testDifferentSampleConfig.
@Test(expected = SampleNotPresentException.class)
public void testDifferentSampleConfig() throws Exception {
SamplerConfigurationImpl sampleConfig = new SamplerConfigurationImpl(RowSampler.class.getName(), ImmutableMap.of("hasher", "murmur3_32", "modulus", "7"));
ConfigurationCopy config1 = newConfig(tempFolder.newFolder().getAbsolutePath());
for (Entry<String, String> entry : sampleConfig.toTablePropertiesMap().entrySet()) {
config1.set(entry.getKey(), entry.getValue());
}
InMemoryMap imm = new InMemoryMap(config1);
mutate(imm, "r", "cf:cq", 5, "b");
SamplerConfigurationImpl sampleConfig2 = new SamplerConfigurationImpl(RowSampler.class.getName(), ImmutableMap.of("hasher", "murmur3_32", "modulus", "9"));
MemoryIterator iter = imm.skvIterator(sampleConfig2);
iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
}
use of org.apache.accumulo.tserver.InMemoryMap.MemoryIterator in project accumulo by apache.
the class InMemoryMapTest method testDuplicateKey.
@Test
public void testDuplicateKey() throws Exception {
InMemoryMap imm = newInMemoryMap(false, tempFolder.newFolder().getAbsolutePath());
Mutation m = new Mutation(new Text("r1"));
m.put(new Text("foo"), new Text("cq"), 3, new Value("v1".getBytes()));
m.put(new Text("foo"), new Text("cq"), 3, new Value("v2".getBytes()));
imm.mutate(Collections.singletonList(m));
MemoryIterator skvi1 = imm.skvIterator(null);
skvi1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
testAndCallNext(skvi1, "r1", "foo:cq", 3, "v2");
testAndCallNext(skvi1, "r1", "foo:cq", 3, "v1");
}
Aggregations