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.
io.datarouter.opencensus.adapter.mixin.IndexedStorageOpencensusAdapterMixin Maven / Gradle / Ivy
/*
* Copyright © 2009 HotPads ([email protected] )
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.datarouter.opencensus.adapter.mixin;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import io.datarouter.model.databean.Databean;
import io.datarouter.model.index.IndexEntry;
import io.datarouter.model.key.primary.PrimaryKey;
import io.datarouter.model.key.unique.UniqueKey;
import io.datarouter.model.serialize.fielder.DatabeanFielder;
import io.datarouter.opencensus.adapter.OpencensusAdapter;
import io.datarouter.scanner.Scanner;
import io.datarouter.storage.config.Config;
import io.datarouter.storage.node.op.raw.IndexedStorage;
import io.datarouter.storage.node.op.raw.IndexedStorage.IndexedStorageNode;
import io.datarouter.storage.node.type.index.ManagedNode;
import io.datarouter.storage.serialize.fieldcache.IndexEntryFieldInfo;
import io.datarouter.util.tuple.Range;
import io.opencensus.common.Scope;
public interface IndexedStorageOpencensusAdapterMixin<
PK extends PrimaryKey,
D extends Databean,
F extends DatabeanFielder,
N extends IndexedStorageNode>
extends IndexedStorage, OpencensusAdapter{
N getBackingNode();
@Override
default void deleteUnique(UniqueKey uniqueKey, Config config){
Optional span = startSpan();
try{
getBackingNode().deleteUnique(uniqueKey, config);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default void deleteMultiUnique(Collection extends UniqueKey> uniqueKeys, Config config){
Optional span = startSpan();
try{
getBackingNode().deleteMultiUnique(uniqueKeys, config);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default ,
IE extends IndexEntry,
IF extends DatabeanFielder> void deleteByIndex(Collection keys, Config config,
IndexEntryFieldInfo indexEntryFieldInfo){
Optional span = startSpan();
try{
getBackingNode().deleteByIndex(keys, config, indexEntryFieldInfo);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default D lookupUnique(UniqueKey uniqueKey, Config config){
Optional span = startSpan();
try{
return getBackingNode().lookupUnique(uniqueKey, config);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default List lookupMultiUnique(Collection extends UniqueKey> uniqueKeys, Config config){
Optional span = startSpan();
try{
return getBackingNode().lookupMultiUnique(uniqueKeys, config);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default ,
IE extends IndexEntry,
IF extends DatabeanFielder>
List getMultiFromIndex(Collection keys, Config config, IndexEntryFieldInfo indexEntryFieldInfo){
Optional span = startSpan();
try{
return getBackingNode().getMultiFromIndex(keys, config, indexEntryFieldInfo);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default ,
IE extends IndexEntry,
IF extends DatabeanFielder>
List getMultiByIndex(Collection keys, Config config, IndexEntryFieldInfo indexEntryFieldInfo){
Optional span = startSpan();
try{
return getBackingNode().getMultiByIndex(keys, config, indexEntryFieldInfo);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default ,
IE extends IndexEntry,
IF extends DatabeanFielder>
Scanner scanRangesIndex(IndexEntryFieldInfo indexEntryFieldInfo, Collection> ranges,
Config config){
Optional span = startSpan();
try{
return getBackingNode().scanRangesIndex(indexEntryFieldInfo, ranges, config);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default ,
IE extends IndexEntry,
IF extends DatabeanFielder>
Scanner scanRangesByIndex(IndexEntryFieldInfo indexEntryFieldInfo, Collection> ranges,
Config config){
Optional span = startSpan();
try{
return getBackingNode().scanRangesByIndex(indexEntryFieldInfo, ranges, config);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default ,
IE extends IndexEntry,
IF extends DatabeanFielder>
Scanner scanRangesIndexKeys(IndexEntryFieldInfo indexEntryFieldInfo, Collection> ranges,
Config config){
Optional span = startSpan();
try{
return getBackingNode().scanRangesIndexKeys(indexEntryFieldInfo, ranges, config);
}finally{
span.ifPresent(Scope::close);
}
}
@Override
default ,
IE extends IndexEntry,
IF extends DatabeanFielder,
MN extends ManagedNode>
MN registerManaged(MN managedNode){
return getBackingNode().registerManaged(managedNode);
}
@Override
default List> getManagedNodes(){
return getBackingNode().getManagedNodes();
}
}