### Question:
OMDBUpdatesHandler extends WriteBatch.Handler { @Override public void put(int cfIndex, byte[] keyBytes, byte[] valueBytes) { try { processEvent(cfIndex, keyBytes, valueBytes, OMDBUpdateEvent.OMDBUpdateAction.PUT); } catch (IOException ioEx) { LOG.error("Exception when reading key : ", ioEx); } } OMDBUpdatesHandler(OMMetadataManager metadataManager); @Override void put(int cfIndex, byte[] keyBytes, byte[] valueBytes); @Override void delete(int cfIndex, byte[] keyBytes); @Override void put(byte[] bytes, byte[] bytes1); @Override void merge(int i, byte[] bytes, byte[] bytes1); @Override void merge(byte[] bytes, byte[] bytes1); @Override void delete(byte[] bytes); @Override void singleDelete(int i, byte[] bytes); @Override void singleDelete(byte[] bytes); @Override void deleteRange(int i, byte[] bytes, byte[] bytes1); @Override void deleteRange(byte[] bytes, byte[] bytes1); @Override void logData(byte[] bytes); @Override void putBlobIndex(int i, byte[] bytes, byte[] bytes1); @Override void markBeginPrepare(); @Override void markEndPrepare(byte[] bytes); @Override void markNoop(boolean b); @Override void markRollback(byte[] bytes); @Override void markCommit(byte[] bytes); List<OMDBUpdateEvent> getEvents();  }### Answer:
@Test public void testPut() throws Exception { OzoneConfiguration configuration = createNewTestPath(); OmMetadataManagerImpl metaMgr = new OmMetadataManagerImpl(configuration); String volumeKey = metaMgr.getVolumeKey("sampleVol"); OmVolumeArgs args = OmVolumeArgs.newBuilder() .setVolume("sampleVol") .setAdminName("bilbo") .setOwnerName("bilbo") .build(); metaMgr.getVolumeTable().put(volumeKey, args); OmKeyInfo firstKey = getOmKeyInfo("sampleVol", "bucketOne", "key_one"); metaMgr.getKeyTable().put("/sampleVol/bucketOne/key_one", firstKey); OmKeyInfo secondKey = getOmKeyInfo("sampleVol", "bucketOne", "key_two"); metaMgr.getKeyTable().put("/sampleVol/bucketOne/key_two", secondKey); OzoneConfiguration conf2 = createNewTestPath(); OmMetadataManagerImpl reconOmmetaMgr = new OmMetadataManagerImpl(conf2); reconOmmetaMgr.getKeyTable().put("/sampleVol/bucketOne/key_two", secondKey); RDBStore rdbStore = (RDBStore) metaMgr.getStore(); RocksDB rocksDB = rdbStore.getDb(); TransactionLogIterator transactionLogIterator = rocksDB.getUpdatesSince(0); List<byte[]> writeBatches = new ArrayList<>(); while(transactionLogIterator.isValid()) { TransactionLogIterator.BatchResult result = transactionLogIterator.getBatch(); result.writeBatch().markWalTerminationPoint(); WriteBatch writeBatch = result.writeBatch(); writeBatches.add(writeBatch.data()); transactionLogIterator.next(); } OMDBUpdatesHandler omdbUpdatesHandler = new OMDBUpdatesHandler(reconOmmetaMgr); for (byte[] data : writeBatches) { WriteBatch writeBatch = new WriteBatch(data); writeBatch.iterate(omdbUpdatesHandler); } List<OMDBUpdateEvent> events = omdbUpdatesHandler.getEvents(); assertEquals(3, events.size()); OMDBUpdateEvent volEvent = events.get(0); assertEquals(PUT, volEvent.getAction()); assertEquals(volumeKey, volEvent.getKey()); assertEquals(args.getVolume(), ((OmVolumeArgs)volEvent.getValue()) .getVolume()); OMDBUpdateEvent keyEvent = events.get(1); assertEquals(PUT, keyEvent.getAction()); assertEquals("/sampleVol/bucketOne/key_one", keyEvent.getKey()); assertNull(keyEvent.getOldValue()); OMDBUpdateEvent updateEvent = events.get(2); assertEquals(UPDATE, updateEvent.getAction()); assertEquals("/sampleVol/bucketOne/key_two", updateEvent.getKey()); assertNotNull(updateEvent.getOldValue()); assertEquals(secondKey.getKeyName(), ((OmKeyInfo)updateEvent.getOldValue()).getKeyName()); }