Esempio n. 1
0
 @Override
 public TimestampedValue<String> score(KijiRowData input, FreshenerContext context)
     throws IOException {
   KeyValueStoreReader<String, String> reader = context.getStore("cats");
   String newName = reader.get("Jennyanydots");
   assertEquals("Old Gumbie Cat", newName);
   return TimestampedValue.create(newName);
 }
Esempio n. 2
0
 @Override
 public boolean isFresh(KijiRowData rowData, FreshenerContext context) {
   final KeyValueStoreReader<String, String> cats;
   try {
     cats = context.getStore("cats");
   } catch (IOException ioe) {
     throw new KijiIOException(ioe);
   }
   if (cats != null) {
     try {
       return cats.get("Skimbleshanks").equals("Railway Cat");
     } catch (IOException ioe) {
       throw new KijiIOException(ioe);
     }
   } else {
     throw new RuntimeException("Could not retrieve KVStoreReader \"cats\" test is broken.");
   }
 }