Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.apache.ignite.internal.restart.RestartProofKeyValueView Maven / Gradle / Ivy
package org .apache .ignite .internal .restart ;
import java .util .Collection ;
import java .util .Map ;
import java .util .Map .Entry ;
import java .util .concurrent .CompletableFuture ;
import java .util .concurrent .Flow .Publisher ;
import java .util .concurrent .Flow .Subscriber ;
import java .util .function .Function ;
import org .apache .ignite .Ignite ;
import org .apache .ignite .lang .AsyncCursor ;
import org .apache .ignite .lang .Cursor ;
import org .apache .ignite .lang .NullableValue ;
import org .apache .ignite .table .DataStreamerItem ;
import org .apache .ignite .table .DataStreamerOptions ;
import org .apache .ignite .table .KeyValueView ;
import org .apache .ignite .table .ReceiverDescriptor ;
import org .apache .ignite .table .criteria .Criteria ;
import org .apache .ignite .table .criteria .CriteriaQueryOptions ;
import org .apache .ignite .tx .Transaction ;
import org .jetbrains .annotations .Nullable ;
API operations on this are linearized with respect to node restarts . Normally (except for situations when timeouts trigger), user
* operations will not interact with detached objects .
*/
class RestartProofKeyValueView extends RestartProofApiObject > implements KeyValueView {
RestartProofKeyValueView (
IgniteAttachmentLock attachmentLock,
Ignite initialIgnite,
Function> viewFactory
) {
super (attachmentLock, initialIgnite, viewFactory);
}
@Override
public @Nullable V get (@Nullable Transaction tx, K key) {
return attached (view -> view.get(tx, key));
}
@Override
public CompletableFuture getAsync (@Nullable Transaction tx, K key) {
return attachedAsync (view -> view.getAsync(tx, key));
}
@Override
public NullableValue getNullable (@Nullable Transaction tx, K key) {
return attached (view -> view.getNullable(tx, key));
}
@Override
public CompletableFuture > getNullableAsync (@Nullable Transaction tx, K key) {
return attachedAsync (view -> view.getNullableAsync(tx, key));
}
@Override
public @Nullable V getOrDefault (@Nullable Transaction tx, K key, @Nullable V defaultValue) {
return attached (view -> view.getOrDefault(tx, key, defaultValue));
}
@Override
public CompletableFuture getOrDefaultAsync (@Nullable Transaction tx, K key, @Nullable V defaultValue) {
return attachedAsync (view -> view.getOrDefaultAsync(tx, key, defaultValue));
}
@Override
public Map getAll (@Nullable Transaction tx, Collection keys) {
return attached (view -> view.getAll(tx, keys));
}
@Override
public CompletableFuture > getAllAsync (@Nullable Transaction tx, Collection keys) {
return attachedAsync (view -> view.getAllAsync(tx, keys));
}
@Override
public boolean contains (@Nullable Transaction tx, K key) {
return attached (view -> view.contains(tx, key));
}
@Override
public CompletableFuture containsAsync (@Nullable Transaction tx, K key) {
return attachedAsync (view -> view.containsAsync(tx, key));
}
@Override
public boolean containsAll (@Nullable Transaction tx, Collection keys) {
return attached (view -> view.containsAll(tx, keys));
}
@Override
public CompletableFuture containsAllAsync (@Nullable Transaction tx, Collection keys) {
return attachedAsync (view -> view.containsAllAsync(tx, keys));
}
@Override
public void put (@Nullable Transaction tx, K key, @Nullable V val) {
consumeAttached (view -> view.put(tx, key, val));
}
@Override
public CompletableFuture putAsync (@Nullable Transaction tx, K key, @Nullable V val) {
return attachedAsync (view -> view.putAsync(tx, key, val));
}
@Override
public void putAll (@Nullable Transaction tx, Map pairs) {
consumeAttached (view -> view.putAll(tx, pairs));
}
@Override
public CompletableFuture putAllAsync (@Nullable Transaction tx, Map pairs) {
return attachedAsync (view -> view.putAllAsync(tx, pairs));
}
@Override
@Nullable
public V getAndPut (@Nullable Transaction tx, K key, @Nullable V val) {
return attached (view -> view.getAndPut(tx, key, val));
}
@Override
public CompletableFuture getAndPutAsync (@Nullable Transaction tx, K key, @Nullable V val) {
return attachedAsync (view -> view.getAndPutAsync(tx, key, val));
}
@Override
public NullableValue getNullableAndPut (@Nullable Transaction tx, K key, @Nullable V val) {
return attached (view -> view.getNullableAndPut(tx, key, val));
}
@Override
public CompletableFuture > getNullableAndPutAsync (@Nullable Transaction tx, K key, @Nullable V val) {
return attachedAsync (view -> view.getNullableAndPutAsync(tx, key, val));
}
@Override
public boolean putIfAbsent (@Nullable Transaction tx, K key, @Nullable V val) {
return attached (view -> view.putIfAbsent(tx, key, val));
}
@Override
public CompletableFuture putIfAbsentAsync (@Nullable Transaction tx, K key, @Nullable V val) {
return attachedAsync (view -> view.putIfAbsentAsync(tx, key, val));
}
@Override
public boolean remove (@Nullable Transaction tx, K key) {
return attached (view -> view.remove(tx, key));
}
@Override
public boolean remove (@Nullable Transaction tx, K key, V val) {
return attached (view -> view.remove(tx, key, val));
}
@Override
public CompletableFuture removeAsync (@Nullable Transaction tx, K key) {
return attachedAsync (view -> view.removeAsync(tx, key));
}
@Override
public CompletableFuture removeAsync (@Nullable Transaction tx, K key, V val) {
return attachedAsync (view -> view.removeAsync(tx, key, val));
}
@Override
public Collection removeAll (@Nullable Transaction tx, Collection keys) {
return attached (view -> view.removeAll(tx, keys));
}
@Override
public CompletableFuture > removeAllAsync (@Nullable Transaction tx, Collection keys) {
return attachedAsync (view -> view.removeAllAsync(tx, keys));
}
@Override
@Nullable
public V getAndRemove (@Nullable Transaction tx, K key) {
return attached (view -> view.getAndRemove(tx, key));
}
@Override
public CompletableFuture getAndRemoveAsync (@Nullable Transaction tx, K key) {
return attachedAsync (view -> view.getAndRemoveAsync(tx, key));
}
@Override
public NullableValue getNullableAndRemove (@Nullable Transaction tx, K key) {
return attached (view -> view.getNullableAndRemove(tx, key));
}
@Override
public CompletableFuture > getNullableAndRemoveAsync (@Nullable Transaction tx, K key) {
return attachedAsync (view -> view.getNullableAndRemoveAsync(tx, key));
}
@Override
public boolean replace (@Nullable Transaction tx, K key, @Nullable V val) {
return attached (view -> view.replace(tx, key, val));
}
@Override
public boolean replace (@Nullable Transaction tx, K key, @Nullable V oldValue, @Nullable V newValue) {
return attached (view -> view.replace(tx, key, oldValue, newValue));
}
@Override
public CompletableFuture replaceAsync (@Nullable Transaction tx, K key, @Nullable V val) {
return attachedAsync (view -> view.replaceAsync(tx, key, val));
}
@Override
public CompletableFuture replaceAsync (@Nullable Transaction tx, K key, @Nullable V oldVal, @Nullable V newVal) {
return attachedAsync (view -> view.replaceAsync(tx, key, oldVal, newVal));
}
@Override
@Nullable
public V getAndReplace (@Nullable Transaction tx, @Nullable K key, @Nullable V val) {
return attached (view -> view.getAndReplace(tx, key, val));
}
@Override
public CompletableFuture getAndReplaceAsync (@Nullable Transaction tx, K key, @Nullable V val) {
return attachedAsync (view -> view.getAndReplaceAsync(tx, key, val));
}
@Override
public NullableValue getNullableAndReplace (@Nullable Transaction tx, K key, @Nullable V val) {
return attached (view -> view.getNullableAndReplace(tx, key, val));
}
@Override
public CompletableFuture > getNullableAndReplaceAsync (@Nullable Transaction tx, K key, @Nullable V val) {
return attachedAsync (view -> view.getNullableAndReplaceAsync(tx, key, val));
}
@Override
public CompletableFuture streamData (Publisher>> publisher, @Nullable DataStreamerOptions options) {
return attachedAsync (view -> view.streamData(publisher, options));
}
@Override
public CompletableFuture streamData (
Publisher publisher,
Function> keyFunc,
Function payloadFunc,
ReceiverDescriptor receiver,
@Nullable Subscriber resultSubscriber,
@Nullable DataStreamerOptions options,
@Nullable A receiverArg
) {
return attachedAsync (view -> view.streamData(publisher, keyFunc, payloadFunc, receiver, resultSubscriber, options, receiverArg));
}
@Override
public Cursor > query (
@Nullable Transaction tx,
@Nullable Criteria criteria,
@Nullable String indexName,
@Nullable CriteriaQueryOptions opts
) {
return attached (view -> view.query(tx, criteria, indexName, opts));
}
@Override
public CompletableFuture >> queryAsync (
@Nullable Transaction tx,
@Nullable Criteria criteria,
@Nullable String indexName,
@Nullable CriteriaQueryOptions opts
) {
return attachedAsync (view -> view.queryAsync(tx, criteria, indexName, opts));
}
}