public void load(HTableInterface table, String cf, Iterable<LookupKV<EnrichmentKey, EnrichmentValue>> results) throws IOException { for(LookupKV<EnrichmentKey, EnrichmentValue> result : results) { Put put = converter.toPut(cf, result.getKey(), result.getValue()); table.put(put); } } }
kv.getValue().getMetadata().put("taxii_url", endpoint.toString()); kv.getValue().getMetadata().put("taxii_collection", collection); Put p = converter.toPut(columnFamily, kv.getKey(), kv.getValue()); HTableInterface table = getTable(hbaseTable); table.put(p);
continue; Put put = converter.toPut(this.cf, key, value); if(put != null) { LOG.debug("Put: {Column Family: '{}', Key: '{}', Value: '{}'}", this.cf, key, value);
@Test public void testValueConversion() throws IOException { EnrichmentConverter converter = new EnrichmentConverter(); EnrichmentKey k1 = new EnrichmentKey("type", "indicator"); EnrichmentValue v1 = new EnrichmentValue(new HashMap<String, Object>() {{ put("k1", "v1"); put("k2", "v2"); }}); Put serialized = converter.toPut("cf", k1, v1); LookupKV<EnrichmentKey, EnrichmentValue> kv = converter.fromPut(serialized,"cf"); Assert.assertEquals(k1, kv.getKey()); Assert.assertEquals(v1, kv.getValue()); } }