com.yandex.ydb.core.rpc.OperationTray Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
JDBC client implementation over Table client, single jar
package com.yandex.ydb.core.rpc;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import com.google.protobuf.Message;
import com.yandex.ydb.OperationProtos.Operation;
import com.yandex.ydb.core.Result;
import com.yandex.ydb.core.Status;
/**
*
* @author Sergey Polovko
*/
public interface OperationTray extends AutoCloseable {
/**
* Awaits operation completion and retrieves its status.
*
* @param operation operation to await for
* @param deadlineAfter point in time when request must expire
* @return future which will be completed with operation status
*/
CompletableFuture waitStatus(Operation operation, long deadlineAfter);
/**
* Awaits operation completion and retrieves its result.
*
* @param operation operation to await for
* @param resultClass class of operation result message
* @param mapper function to map result message to appropriate result*
* @param deadlineAfter point in time when request must expire
* @return future which will be completed with operation result
*/
CompletableFuture> waitResult(
Operation operation,
Class resultClass,
Function mapper,
long deadlineAfter);
/**
* Stops active tasks and release resources.
*/
@Override
void close();
}