### Question:
OzoneManagerServiceProviderImpl implements OzoneManagerServiceProvider { @VisibleForTesting void getAndApplyDeltaUpdatesFromOM( long fromSequenceNumber, OMDBUpdatesHandler omdbUpdatesHandler) throws IOException, RocksDBException { DBUpdatesRequest dbUpdatesRequest = DBUpdatesRequest.newBuilder() .setSequenceNumber(fromSequenceNumber).build(); DBUpdates dbUpdates = ozoneManagerClient.getDBUpdates(dbUpdatesRequest); if (null != dbUpdates) { RDBStore rocksDBStore = (RDBStore) omMetadataManager.getStore(); RocksDB rocksDB = rocksDBStore.getDb(); int numUpdates = dbUpdates.getData().size(); LOG.info("Number of updates received from OM : {}", numUpdates); if (numUpdates > 0) { metrics.incrNumUpdatesInDeltaTotal(numUpdates); } for (byte[] data : dbUpdates.getData()) { try (WriteBatch writeBatch = new WriteBatch(data)) { writeBatch.iterate(omdbUpdatesHandler); try (RDBBatchOperation rdbBatchOperation = new RDBBatchOperation(writeBatch)) { try (WriteOptions wOpts = new WriteOptions()) { rdbBatchOperation.commit(rocksDB, wOpts); } } } } } } @Inject  OzoneManagerServiceProviderImpl(
      OzoneConfiguration configuration,
      ReconOMMetadataManager omMetadataManager,
      ReconTaskController reconTaskController,
      ReconUtils reconUtils,
      OzoneManagerProtocol ozoneManagerClient); void registerOMDBTasks(); @Override OMMetadataManager getOMMetadataManagerInstance(); @Override void start(); @Override void stop(); @VisibleForTesting String getOzoneManagerSnapshotUrl(); @VisibleForTesting void syncDataFromOM(); OzoneManagerSyncMetrics getMetrics();  }### Answer:
@Test public void testGetAndApplyDeltaUpdatesFromOM() throws Exception { OMMetadataManager sourceOMMetadataMgr = initializeNewOmMetadataManager(temporaryFolder.newFolder()); writeDataToOm(sourceOMMetadataMgr, "key_one"); writeDataToOm(sourceOMMetadataMgr, "key_two"); RocksDB rocksDB = ((RDBStore)sourceOMMetadataMgr.getStore()).getDb(); TransactionLogIterator transactionLogIterator = rocksDB.getUpdatesSince(0L); DBUpdates dbUpdatesWrapper = new DBUpdates(); while(transactionLogIterator.isValid()) { TransactionLogIterator.BatchResult result = transactionLogIterator.getBatch(); result.writeBatch().markWalTerminationPoint(); WriteBatch writeBatch = result.writeBatch(); dbUpdatesWrapper.addWriteBatch(writeBatch.data(), result.sequenceNumber()); transactionLogIterator.next(); } OMMetadataManager omMetadataManager = initializeNewOmMetadataManager(temporaryFolder.newFolder()); OzoneManagerServiceProviderImpl ozoneManagerServiceProvider = new OzoneManagerServiceProviderImpl(configuration, getTestReconOmMetadataManager(omMetadataManager, temporaryFolder.newFolder()), getMockTaskController(), new ReconUtils(), getMockOzoneManagerClient(dbUpdatesWrapper)); OMDBUpdatesHandler updatesHandler = new OMDBUpdatesHandler(omMetadataManager); ozoneManagerServiceProvider.getAndApplyDeltaUpdatesFromOM( 0L, updatesHandler); OzoneManagerSyncMetrics metrics = ozoneManagerServiceProvider.getMetrics(); assertEquals(4.0, metrics.getAverageNumUpdatesInDeltaRequest().value(), 0.0); assertEquals(1, metrics.getNumNonZeroDeltaRequests().value()); assertEquals(4, updatesHandler.getEvents().size()); String fullKey = omMetadataManager.getOzoneKey("sampleVol", "bucketOne", "key_one"); assertTrue(ozoneManagerServiceProvider.getOMMetadataManagerInstance() .getKeyTable().isExist(fullKey)); fullKey = omMetadataManager.getOzoneKey("sampleVol", "bucketOne", "key_two"); assertTrue(ozoneManagerServiceProvider.getOMMetadataManagerInstance() .getKeyTable().isExist(fullKey)); }