com.groupbyinc.flux.snapshots.RestoreService.class Maven / Gradle / Ivy
???? 4? ,com/groupbyinc/flux/snapshots/RestoreService 6com/groupbyinc/flux/common/component/AbstractComponent /com/groupbyinc/flux/cluster/ClusterStateApplier RestoreService.java Mcom/groupbyinc/flux/snapshots/RestoreService$UpdateRestoreStateRequestHandler UpdateRestoreStateRequestHandler Qcom/groupbyinc/flux/snapshots/RestoreService$UpdateIndexShardRestoreStatusRequest $UpdateIndexShardRestoreStatusRequest ;com/groupbyinc/flux/snapshots/RestoreService$RestoreRequest RestoreRequest Jcom/groupbyinc/flux/snapshots/RestoreService$CleanRestoreStateTaskExecutor CleanRestoreStateTaskExecutor Ecom/groupbyinc/flux/snapshots/RestoreService$RestoreInProgressUpdater RestoreInProgressUpdater Fcom/groupbyinc/flux/snapshots/RestoreService$RestoreCompletionResponse RestoreCompletionResponse .com/groupbyinc/flux/snapshots/RestoreService$2 .com/groupbyinc/flux/snapshots/RestoreService$1 ;com/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder 3com/groupbyinc/flux/common/collect/ImmutableOpenMap Builder 3com/groupbyinc/flux/cluster/RestoreInProgress$Entry # -com/groupbyinc/flux/cluster/RestoreInProgress % Entry @com/groupbyinc/flux/cluster/RestoreInProgress$ShardRestoreStatus ( ShardRestoreStatus 3com/groupbyinc/flux/cluster/RestoreInProgress$State + State /com/groupbyinc/flux/cluster/ClusterState$Custom . (com/groupbyinc/flux/cluster/ClusterState 0 Custom /com/groupbyinc/flux/threadpool/ThreadPool$Names 3 )com/groupbyinc/flux/threadpool/ThreadPool 5 Names Ocom/groupbyinc/flux/snapshots/RestoreService$CleanRestoreStateTaskExecutor$Task 8 Task Icom/groupbyinc/flux/cluster/routing/RecoverySource$SnapshotRecoverySource ; 2com/groupbyinc/flux/cluster/routing/RecoverySource = SnapshotRecoverySource 7com/groupbyinc/flux/cluster/routing/RecoverySource$Type @ Type 0com/groupbyinc/flux/cluster/ClusterState$Builder C %java/lang/invoke/MethodHandles$Lookup E java/lang/invoke/MethodHandles G Lookup V_5_1_0_UNRELEASED Lcom/groupbyinc/flux/Version; UPDATE_RESTORE_ACTION_NAME Ljava/lang/String; (internal:cluster/snapshot/update_restore N UNMODIFIABLE_SETTINGS Ljava/util/Set; #Ljava/util/Set; UNREMOVABLE_SETTINGS clusterService 4Lcom/groupbyinc/flux/cluster/service/ClusterService; repositoriesService 6Lcom/groupbyinc/flux/repositories/RepositoriesService; transportService 0Lcom/groupbyinc/flux/transport/TransportService; allocationService BLcom/groupbyinc/flux/cluster/routing/allocation/AllocationService; createIndexService ALcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService; metaDataIndexUpgradeService BLcom/groupbyinc/flux/cluster/metadata/MetaDataIndexUpgradeService; clusterSettings 5Lcom/groupbyinc/flux/common/settings/ClusterSettings; cleanRestoreStateTaskExecutor LLcom/groupbyinc/flux/snapshots/RestoreService$CleanRestoreStateTaskExecutor; $assertionsDisabled Z ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/cluster/service/ClusterService;Lcom/groupbyinc/flux/repositories/RepositoriesService;Lcom/groupbyinc/flux/transport/TransportService;Lcom/groupbyinc/flux/cluster/routing/allocation/AllocationService;Lcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService;Lcom/groupbyinc/flux/cluster/metadata/MetaDataIndexUpgradeService;Lcom/groupbyinc/flux/common/settings/ClusterSettings;)V *Lcom/groupbyinc/flux/common/inject/Inject; 1(Lcom/groupbyinc/flux/common/settings/Settings;)V f i
j T U l V W n X Y p Z [ r \ ] t ^ _ v "java/lang/invoke/LambdaMetafactory x metafactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; z {
y | } ()Ljava/lang/Object; ()V f ?
? ? U()Lcom/groupbyinc/flux/snapshots/RestoreService$UpdateIndexShardRestoreStatusRequest; ? get ()Ljava/util/function/Supplier; ? ? ? same ? 1(Lcom/groupbyinc/flux/snapshots/RestoreService;)V f ?
? .com/groupbyinc/flux/transport/TransportService ? registerRequestHandler {(Ljava/lang/String;Ljava/util/function/Supplier;Ljava/lang/String;Lcom/groupbyinc/flux/transport/TransportRequestHandler;)V ? ?
? ? 2com/groupbyinc/flux/cluster/service/ClusterService ? addStateApplier 4(Lcom/groupbyinc/flux/cluster/ClusterStateApplier;)V ? ?
? ? ` a ? logger 8Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger; ? ? ? ;(Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger;)V f ?
? b c ? this .Lcom/groupbyinc/flux/snapshots/RestoreService; settings .Lcom/groupbyinc/flux/common/settings/Settings; restoreSnapshot k(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Lcom/groupbyinc/flux/action/ActionListener;)V java/lang/Exception ?
access$000 Q(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;)Ljava/lang/String; ? ?
? 4com/groupbyinc/flux/repositories/RepositoriesService ?
repository A(Ljava/lang/String;)Lcom/groupbyinc/flux/repositories/Repository; ? ?
? ? +com/groupbyinc/flux/repositories/Repository ? getRepositoryData 3()Lcom/groupbyinc/flux/repositories/RepositoryData; ? ? ? ? /com/groupbyinc/flux/repositories/RepositoryData ? getIncompatibleSnapshotIds ()Ljava/util/List; ? ?
? ? java/util/List ? stream ()Ljava/util/stream/Stream; ? ? ? ? (Ljava/lang/Object;)Z ? lambda$restoreSnapshot$0 j(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Lcom/groupbyinc/flux/snapshots/SnapshotId;)Z ? ?
? ? -(Lcom/groupbyinc/flux/snapshots/SnapshotId;)Z ? test ](Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;)Ljava/util/function/Predicate; ? ? ? java/util/stream/Stream ? filter 9(Ljava/util/function/Predicate;)Ljava/util/stream/Stream; ? ? ? ? findFirst ()Ljava/util/Optional; ? ? ? ? java/util/Optional ? isPresent ()Z ? ?
? ? 6com/groupbyinc/flux/snapshots/SnapshotRestoreException ?
access$100 ? ?
? $cannot restore incompatible snapshot ? 9(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V f ?
? ? getSnapshotIds ? ?
? ? lambda$restoreSnapshot$1 ? ?
? ? ? snapshot does not exist ? ?
? ? (com/groupbyinc/flux/snapshots/SnapshotId ? getSnapshotInfo X(Lcom/groupbyinc/flux/snapshots/SnapshotId;)Lcom/groupbyinc/flux/snapshots/SnapshotInfo; ? &com/groupbyinc/flux/snapshots/Snapshot ?(Ljava/lang/String;Lcom/groupbyinc/flux/snapshots/SnapshotId;)V f
*com/groupbyinc/flux/snapshots/SnapshotInfo indices ?
()[Ljava/lang/String;
indicesOptions 5()Lcom/groupbyinc/flux/action/support/IndicesOptions;
+com/groupbyinc/flux/snapshots/SnapshotUtils
filterIndices h(Ljava/util/List;[Ljava/lang/String;Lcom/groupbyinc/flux/action/support/IndicesOptions;)Ljava/util/List;
resolveIndices "(Ljava/util/List;)Ljava/util/List;
? getSnapshotMetaData m(Lcom/groupbyinc/flux/snapshots/SnapshotInfo;Ljava/util/List;)Lcom/groupbyinc/flux/cluster/metadata/MetaData; ?! version ()Lcom/groupbyinc/flux/Version;#$
% com/groupbyinc/flux/Version'
V_2_0_0_beta1) K (* before (Lcom/groupbyinc/flux/Version;)Z,-
(. -com/groupbyinc/flux/cluster/metadata/MetaData0 addDefaultUnitsIfNeeded ?(Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/cluster/metadata/MetaData;)Lcom/groupbyinc/flux/cluster/metadata/MetaData;23
14 )com/groupbyinc/flux/action/ActionListener6 validateSnapshotRestorable A(Ljava/lang/String;Lcom/groupbyinc/flux/snapshots/SnapshotInfo;)V89
: renamedIndices ^(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Ljava/util/List;)Ljava/util/Map;<=
> cause ()Ljava/lang/String;@A
BU(Lcom/groupbyinc/flux/snapshots/RestoreService;Lcom/groupbyinc/flux/snapshots/Snapshot;Ljava/util/Map;Lcom/groupbyinc/flux/snapshots/SnapshotInfo;Lcom/groupbyinc/flux/cluster/metadata/MetaData;Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Lcom/groupbyinc/flux/snapshots/SnapshotId;Lcom/groupbyinc/flux/action/ActionListener;)V fD
E submitStateUpdateTask I(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/ClusterStateTaskConfig;)VGH
?I lambda$restoreSnapshot$2 Q(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;)Ljava/lang/Object;KL
MN ~(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;)Lcom/groupbyinc/flux/common/apache/logging/log4j/util/Supplier; ?P Q 6com/groupbyinc/flux/common/apache/logging/log4j/LoggerS warn W(Lcom/groupbyinc/flux/common/apache/logging/log4j/util/Supplier;Ljava/lang/Throwable;)VUVTW onFailure (Ljava/lang/Exception;)VYZ7[ metaData /Lcom/groupbyinc/flux/cluster/metadata/MetaData; -Lcom/groupbyinc/flux/repositories/Repository; repositoryData 1Lcom/groupbyinc/flux/repositories/RepositoryData; incompatibleSnapshotId @Ljava/util/Optional; Ljava/util/Optional; matchingSnapshotId
snapshotId *Lcom/groupbyinc/flux/snapshots/SnapshotId; snapshotInfo ,Lcom/groupbyinc/flux/snapshots/SnapshotInfo; snapshot (Lcom/groupbyinc/flux/snapshots/Snapshot; filteredIndices $Ljava/util/List; Ljava/util/List;
metaDataIn 5Ljava/util/Map; Ljava/util/Map; e Ljava/lang/Exception; request =Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest; listener uLcom/groupbyinc/flux/action/ActionListener; +Lcom/groupbyinc/flux/action/ActionListener; $updateRestoreStateWithDeletedIndices o(Lcom/groupbyinc/flux/cluster/RestoreInProgress;Ljava/util/Set;)Lcom/groupbyinc/flux/cluster/RestoreInProgress; java/util/ArrayList{
| ? entries~ ?
& iterator ()Ljava/util/Iterator;?? ?? java/util/Iterator? hasNext? ??? next? ?? shards 7()Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;??
$?
!? Gcom/groupbyinc/flux/common/carrotsearch/hppc/cursors/ObjectObjectCursor? key Ljava/lang/Object;?? ?? 'com/groupbyinc/flux/index/shard/ShardId? getIndex #()Lcom/groupbyinc/flux/index/Index;??
??
java/util/Set? contains? ??? builder t(Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;)Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder;??
!? FAILURE 5Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;?? ,? index was deleted? \(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;Ljava/lang/String;)V f?
)? put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;??
? build??
? *()Lcom/groupbyinc/flux/snapshots/Snapshot;j?
$? STARTED?? ,? overallState ?(Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;)Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;??
?
$ ?(Lcom/groupbyinc/flux/snapshots/Snapshot;Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;Ljava/util/List;Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;)V f?
$? add? ? ?? size ()I?? ?? toArray (([Ljava/lang/Object;)[Ljava/lang/Object;?? ?? 6[Lcom/groupbyinc/flux/cluster/RestoreInProgress$Entry;? 9([Lcom/groupbyinc/flux/cluster/RestoreInProgress$Entry;)V f?
&? shardId )Lcom/groupbyinc/flux/index/shard/ShardId; cursor ?Lcom/groupbyinc/flux/common/carrotsearch/hppc/cursors/ObjectObjectCursor; ILcom/groupbyinc/flux/common/carrotsearch/hppc/cursors/ObjectObjectCursor; ?Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap; 5Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;
shardsBuilder ?Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder; =Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap$Builder; entry 5Lcom/groupbyinc/flux/cluster/RestoreInProgress$Entry;
oldRestore /Lcom/groupbyinc/flux/cluster/RestoreInProgress; deletedIndices 2Ljava/util/Set; changesMade GLjava/util/List; restoreInProgress ?(Lcom/groupbyinc/flux/cluster/ClusterState;Lcom/groupbyinc/flux/snapshots/Snapshot;)Lcom/groupbyinc/flux/cluster/RestoreInProgress$Entry; restore? custom E(Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/ClusterState$Custom;??
1? equals? ?
? state *Lcom/groupbyinc/flux/cluster/ClusterState; cleanupRestoreState 4(Lcom/groupbyinc/flux/cluster/ClusterChangedEvent;)V /com/groupbyinc/flux/cluster/ClusterChangedEvent? ,()Lcom/groupbyinc/flux/cluster/ClusterState;??
?? 7()Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;??
$? completed? ?
,? d e 8(Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;)Z?
java/lang/AssertionError 0state says completed but restore entries are not (Ljava/lang/Object;)V f
clean up snapshot restore state
+(Lcom/groupbyinc/flux/snapshots/Snapshot;)V f
9 #com/groupbyinc/flux/common/Priority URGENT %Lcom/groupbyinc/flux/common/Priority; 2com/groupbyinc/flux/cluster/ClusterStateTaskConfig [(Lcom/groupbyinc/flux/common/Priority;)Lcom/groupbyinc/flux/cluster/ClusterStateTaskConfig;? ?(Ljava/lang/String;Ljava/lang/Object;Lcom/groupbyinc/flux/cluster/ClusterStateTaskConfig;Lcom/groupbyinc/flux/cluster/ClusterStateTaskExecutor;Lcom/groupbyinc/flux/cluster/ClusterStateTaskListener;)VG
? localNodeMaster ?
?!
previousState#?
?$ nodes 3()Lcom/groupbyinc/flux/cluster/node/DiscoveryNodes;&'
1( /com/groupbyinc/flux/cluster/node/DiscoveryNodes* isLocalNodeElectedMaster, ?
+- (update restore state after master switch/
? event 1Lcom/groupbyinc/flux/cluster/ClusterChangedEvent; 'resyncRestoreInProgressWithRoutingTable V(Lcom/groupbyinc/flux/cluster/ClusterState;)Lcom/groupbyinc/flux/cluster/ClusterState; routingTable 4()Lcom/groupbyinc/flux/cluster/routing/RoutingTable;67
18 0com/groupbyinc/flux/cluster/routing/RoutingTable: shardRoutingTableOrNull g(Lcom/groupbyinc/flux/index/shard/ShardId;)Lcom/groupbyinc/flux/cluster/routing/IndexShardRoutingTable;<=
;> :com/groupbyinc/flux/cluster/routing/IndexShardRoutingTable@ valueB? ?C
)? INITF? ,G
? primaryShard 4()Lcom/groupbyinc/flux/cluster/routing/ShardRouting;JK
AL 0com/groupbyinc/flux/cluster/routing/ShardRoutingN activeP ?
OQ
currentNodeIdSA
OT SUCCESSV? ,W J(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;)V fY
)Z
unassigned\ ?
O] initializing_ ?
O` recoverySource 6()Lcom/groupbyinc/flux/cluster/routing/RecoverySource;bc
Od getType ;()Lcom/groupbyinc/flux/cluster/routing/RecoverySource$Type;fg
>h SNAPSHOT 9Lcom/groupbyinc/flux/cluster/routing/RecoverySource$Type;jk Al
<? java/lang/StringBuildero
p ? .recovery source type changed from snapshot to r append -(Ljava/lang/String;)Ljava/lang/StringBuilder;tu
pv -(Ljava/lang/Object;)Ljava/lang/StringBuilder;tx
py toString{A
p|
getCustoms~?
1 ^(Lcom/groupbyinc/flux/cluster/ClusterState;)Lcom/groupbyinc/flux/cluster/ClusterState$Builder;??
1? customs i(Lcom/groupbyinc/flux/common/collect/ImmutableOpenMap;)Lcom/groupbyinc/flux/cluster/ClusterState$Builder;??
D???
D? 2Lcom/groupbyinc/flux/cluster/routing/ShardRouting; indexShardRoutingTable