code: public void writeSync(T op, WriteBuilder at) throws IOException, InterruptedException {
          if (syncLevel == SyncLevel.BATCH_ASYNC) {
              throw new IllegalArgumentException("You can't use WriteSync for this cube with " +
                      "SyncLevel " + syncLevel);
          }
  
          Optional<Future<?>> optFuture;
          try {
              optFuture = writeAsync(op, at);
          } catch (AsyncException pe) {
              throw new RuntimeException("Internal error, when at a synchronized syncLevel there should" +
                      " be no asynchronous exceptions");
          }
  
          if (optFuture.isPresent()) {
              // Our write triggered a batch flush. Wait for it to finish, rethrowing exceptions.
              try {
                  optFuture.get().get();
              } catch (ExecutionException ee) {
                  Throwable flushException = ee.getCause();
                  if (flushException instanceof IOException) {
                      throw (IOException) flushException;
                  } else if (flushException instanceof InterruptedException) {
                      throw (InterruptedException) flushException;
                  } else if (flushException instanceof RuntimeException) {
                      throw new RuntimeException(flushException);
                  } else {
                      throw new RuntimeException("Unreachable");
                  }
              }
          } else {
              // Our write updated a batch in memory without causing a flush. Return success.
          }
      }
docs: If the {@link SyncLevel} is {@link SyncLevel#FULL_SYNC} or {@link SyncLevel#BATCH_SYNC}, then
  no asynchronous IO is happening. You can use this function to write instead of
  {@link #writeAsync(Op, WriteBuilder)} without catching AsyncException or InterruptedException.
  <p>
  IMPORTANT: the name of this function does not imply that the write is immediately flushed to
  the database. This is only true if {@link SyncLevel#FULL_SYNC} is set. Otherwise your write
  is probably just staged in a batch for writing later.
  <p>
  You can only use this function if this DataCubeIo was constructed with
  {@link SyncLevel#FULL_SYNC} or {@link SyncLevel#BATCH_SYNC}.