public void write(String path, ZNRecord zNRecord) throws Exception {
    AtomicReference<Exception> exceptionRef = new AtomicReference<>();
    CountDownLatch latch = new CountDownLatch(1);
    StoreOperationListener operationListener =
        new StoreOperationListener(latch, StoreOperationType.WRITE, exceptionRef);
    helixStore.subscribe(path, operationListener);
    helixStore.set(path, zNRecord, AccessOption.PERSISTENT);
    awaitLatchOrTimeout(latch, OPERATION_TIMEOUT_MS);
    helixStore.unsubscribe(path, operationListener);
    if (exceptionRef.get() != null) {
      throw exceptionRef.get();
    }
  }
Writes a {@link ZNRecord} to a store path. This operation is blocking.
@param path The store path to write. This is a relative path under the store root path.
@param zNRecord The {@link ZNRecord} to write.
@throws Exception
ambry-clustermap/src/test/java/com/github/ambry/clustermap/HelixStoreOperator.java