com.groupbyinc.flux.cluster.metadata.MetaDataCreateIndexService.class Maven / Gradle / Ivy
???? 4? ?com/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService 6com/groupbyinc/flux/common/component/AbstractComponent MetaDataCreateIndexService.java Qcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService$IndexCreationTask IndexCreationTask Ncom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService$IndexValidator IndexValidator 4com/groupbyinc/flux/common/settings/Settings$Builder ,com/groupbyinc/flux/common/settings/Settings Builder java/util/Map$Entry
java/util/Map Entry 8com/groupbyinc/flux/common/settings/Setting$AffixSetting +com/groupbyinc/flux/common/settings/Setting AffixSetting 4com/groupbyinc/flux/common/settings/Setting$Property Property %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup deprecationLogger 6Lcom/groupbyinc/flux/common/logging/DeprecationLogger; MAX_INDEX_NAME_BYTES I ? clusterService 4Lcom/groupbyinc/flux/cluster/service/ClusterService; indicesService ,Lcom/groupbyinc/flux/indices/IndicesService; allocationService BLcom/groupbyinc/flux/cluster/routing/allocation/AllocationService; aliasValidator 5Lcom/groupbyinc/flux/cluster/metadata/AliasValidator; env %Lcom/groupbyinc/flux/env/Environment; indexScopedSettings 9Lcom/groupbyinc/flux/common/settings/IndexScopedSettings; activeShardsObserver 9Lcom/groupbyinc/flux/action/support/ActiveShardsObserver; xContentRegistry ;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry; $assertionsDisabled Z ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/cluster/service/ClusterService;Lcom/groupbyinc/flux/indices/IndicesService;Lcom/groupbyinc/flux/cluster/routing/allocation/AllocationService;Lcom/groupbyinc/flux/cluster/metadata/AliasValidator;Lcom/groupbyinc/flux/env/Environment;Lcom/groupbyinc/flux/common/settings/IndexScopedSettings;Lcom/groupbyinc/flux/threadpool/ThreadPool;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;)V *Lcom/groupbyinc/flux/common/inject/Inject; 1(Lcom/groupbyinc/flux/common/settings/Settings;)V : =
> ( ) @ * + B , - D . / F 0 1 H 2 3 J 7com/groupbyinc/flux/action/support/ActiveShardsObserver L ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/cluster/service/ClusterService;Lcom/groupbyinc/flux/threadpool/ThreadPool;)V : N
M O 4 5 Q 6 7 S this ALcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService; settings .Lcom/groupbyinc/flux/common/settings/Settings;
threadPool +Lcom/groupbyinc/flux/threadpool/ThreadPool; validateIndexName ?(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/ClusterState;)V "java/lang/invoke/LambdaMetafactory ] 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; _ `
^ a b 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; d 5com/groupbyinc/flux/indices/InvalidIndexNameException f '(Ljava/lang/String;Ljava/lang/String;)V : h
g i j B(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/RuntimeException; l apply !()Ljava/util/function/BiFunction; n o p validateIndexOrAliasName 4(Ljava/lang/String;Ljava/util/function/BiFunction;)V r s
t java/util/Locale v ROOT Ljava/util/Locale; x y w z java/lang/String | toLowerCase &(Ljava/util/Locale;)Ljava/lang/String; ~
} ? equals (Ljava/lang/Object;)Z ? ?
} ? must be lowercase ? (com/groupbyinc/flux/cluster/ClusterState ? routingTable 4()Lcom/groupbyinc/flux/cluster/routing/RoutingTable; ? ?
? ? 0com/groupbyinc/flux/cluster/routing/RoutingTable ? hasIndex (Ljava/lang/String;)Z ? ?
? ? 2com/groupbyinc/flux/ResourceAlreadyExistsException ? index K(Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/routing/IndexRoutingTable; ? ?
? ? 5com/groupbyinc/flux/cluster/routing/IndexRoutingTable ? getIndex #()Lcom/groupbyinc/flux/index/Index; ? ?
? ? $(Lcom/groupbyinc/flux/index/Index;)V : ?
? ? metaData 1()Lcom/groupbyinc/flux/cluster/metadata/MetaData; ? ?
? ? -com/groupbyinc/flux/cluster/metadata/MetaData ?
? ? H(Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/metadata/IndexMetaData; ? ?
? ? 2com/groupbyinc/flux/cluster/metadata/IndexMetaData ?
? ? hasAlias ? ?
? ? already exists as alias ? Ljava/lang/String; state *Lcom/groupbyinc/flux/cluster/ClusterState; $java/io/UnsupportedEncodingException ? "com/groupbyinc/flux/common/Strings ?
validFileName ? ?
? ? java/lang/StringBuilder ? ()V : ?
? ? *must not contain the following characters ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
? ? INVALID_FILENAME_CHARS Ljava/util/Set; ? ? ? ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder; ? ?
? ? toString ()Ljava/lang/String; ? ?
? ? java/util/function/BiFunction ? n d ? ? java/lang/RuntimeException ? # ? contains (Ljava/lang/CharSequence;)Z ? ?
} ? must not contain '#' ? : ? # $ ? index or alias name [ ? N] containing ':' is deprecated and will not be supported in Elasticsearch 7.0+ ? java/lang/Object ? 4com/groupbyinc/flux/common/logging/DeprecationLogger ?
deprecated ((Ljava/lang/String;[Ljava/lang/Object;)V ? ?
? ? charAt (I)C ? ?
} ? $must not start with '_', '-', or '+' ? UTF-8 ? getBytes (Ljava/lang/String;)[B ? ?
} ? *com/groupbyinc/flux/ElasticsearchException ? (Unable to determine length of index name =(Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V :
index name is too long, ( (I)Ljava/lang/StringBuilder; ?
? > )
. .. must not be '.' or '..' e &Ljava/io/UnsupportedEncodingException;
exceptionCtor bLjava/util/function/BiFunction; Ljava/util/function/BiFunction; byteCount createIndex ?(Lcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequest;Lcom/groupbyinc/flux/action/ActionListener;)V (Ljava/lang/Object;)V lambda$createIndex$1 ?(Lcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequest;Lcom/groupbyinc/flux/action/ActionListener;Lcom/groupbyinc/flux/cluster/ack/ClusterStateUpdateResponse;)V
!" ?(Lcom/groupbyinc/flux/cluster/ack/ClusterStateUpdateResponse;)V$ accept ?(Lcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService;Lcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequest;Lcom/groupbyinc/flux/action/ActionListener;)Lcom/groupbyinc/flux/common/CheckedConsumer;&' ( java/util/Objects* requireNonNull &(Ljava/lang/Object;)Ljava/lang/Object;,-
+. )com/groupbyinc/flux/action/ActionListener0 onFailure (Ljava/lang/Exception;)V2314 53 J(Lcom/groupbyinc/flux/action/ActionListener;)Ljava/util/function/Consumer;&8 9 wrap v(Lcom/groupbyinc/flux/common/CheckedConsumer;Ljava/util/function/Consumer;)Lcom/groupbyinc/flux/action/ActionListener;;<1= onlyCreateIndex?
@ request VLcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequest; listener tLcom/groupbyinc/flux/action/ActionListener; +Lcom/groupbyinc/flux/action/ActionListener; builder 8()Lcom/groupbyinc/flux/common/settings/Settings$Builder;GH
I Tcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequestK 0()Lcom/groupbyinc/flux/common/settings/Settings; WM
LN put f(Lcom/groupbyinc/flux/common/settings/Settings;)Lcom/groupbyinc/flux/common/settings/Settings$Builder;PQ
R index.T normalizePrefix J(Ljava/lang/String;)Lcom/groupbyinc/flux/common/settings/Settings$Builder;VW
X buildZM
[ 7com/groupbyinc/flux/common/settings/IndexScopedSettings] validate 2(Lcom/groupbyinc/flux/common/settings/Settings;Z)V_`
^a ?(Lcom/groupbyinc/flux/common/settings/Settings;)Lcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequest; Wc
Ld create-index [f ? ?
Lh
], cause [j causel ?
Lm ]o logger !Lorg/apache/logging/log4j/Logger;qr s W X u ?(Lcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequest;Lcom/groupbyinc/flux/cluster/ClusterState;)Vw_w
yz ?(Lcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService;)Lcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService$IndexValidator;_| }:(Lorg/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/cluster/routing/allocation/AllocationService;Lcom/groupbyinc/flux/action/admin/indices/create/CreateIndexClusterStateUpdateRequest;Lcom/groupbyinc/flux/action/ActionListener;Lcom/groupbyinc/flux/indices/IndicesService;Lcom/groupbyinc/flux/cluster/metadata/AliasValidator;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService$IndexValidator;Lcom/groupbyinc/flux/common/settings/IndexScopedSettings;)V :
? 2com/groupbyinc/flux/cluster/service/ClusterService? submitStateUpdateTask I(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/ClusterStateTaskConfig;)V??
?? iLcom/groupbyinc/flux/action/ActionListener; updatedSettingsBuilder 6Lcom/groupbyinc/flux/common/settings/Settings$Builder; [ \
? validateIndexSettings C(Ljava/lang/String;Lcom/groupbyinc/flux/common/settings/Settings;)V??
? 2com/groupbyinc/flux/indices/IndexCreationException? getIndexSettingsValidationErrors @(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/util/List;??
? java/util/List? isEmpty ()Z???? .com/groupbyinc/flux/common/ValidationException?
? ? addValidationErrors (Ljava/lang/Iterable;)V??
?? *(Ljava/lang/String;Ljava/lang/Throwable;)V :?
?? validationException 0Lcom/groupbyinc/flux/common/ValidationException; indexName validationErrors $Ljava/util/List; Ljava/util/List; INDEX_DATA_PATH_SETTING -Lcom/groupbyinc/flux/common/settings/Setting;?? ?? get B(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/lang/Object;??
? java/util/ArrayList?
? ?? ?
?? #com/groupbyinc/flux/env/Environment? sharedDataFile ()Ljava/nio/file/Path;??
?? >path.shared_data must be set in order to use custom data paths? add? ??? java/nio/file/Path? 'com/groupbyinc/flux/common/io/PathUtils? =([Ljava/nio/file/Path;Ljava/lang/String;)Ljava/nio/file/Path;??
??
custom path [? )] is not a sub-path of path.shared_data [? resolvedPath Ljava/nio/file/Path;
customPath validateShrinkIndex ?(Lcom/groupbyinc/flux/cluster/ClusterState;Ljava/lang/String;Ljava/util/Set;Ljava/lang/String;Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/util/List; validateResize ?(Lcom/groupbyinc/flux/cluster/ClusterState;Ljava/lang/String;Ljava/util/Set;Ljava/lang/String;Lcom/groupbyinc/flux/common/settings/Settings;)Lcom/groupbyinc/flux/cluster/metadata/IndexMetaData;??
? 8 9 ? INDEX_NUMBER_OF_SHARDS_SETTING?? ?? exists 1(Lcom/groupbyinc/flux/common/settings/Settings;)Z??
? java/lang/AssertionError?
? ? java/lang/Integer? intValue ()I??
?? selectShrinkShards G(ILcom/groupbyinc/flux/cluster/metadata/IndexMetaData;I)Ljava/util/Set;??
?? getNumberOfShards??
?? "java/lang/IllegalArgumentException? )can't shrink an index with only one shard? (Ljava/lang/String;)V :?
?? java/util/HashMap?
? ? 5com/groupbyinc/flux/cluster/routing/ShardRoutingState? STARTED 7Lcom/groupbyinc/flux/cluster/routing/ShardRoutingState;?? ? shardsWithState I(Lcom/groupbyinc/flux/cluster/routing/ShardRoutingState;)Ljava/util/List;
? iterator ()Ljava/util/Iterator;?
java/util/Set
java/util/Iterator hasNext?
next ()Ljava/lang/Object;
0com/groupbyinc/flux/cluster/routing/ShardRouting
currentNodeId ?
- lambda$validateShrinkIndex$2 ?(Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicInteger;
()Ljava/util/function/Function; n! " computeIfAbsent C(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;$% & )java/util/concurrent/atomic/AtomicInteger( incrementAndGet*?
)+ entrySet ()Ljava/util/Set;-. / getValue2 3??
)5 wait what? 7 is > than num shards 9 :
?; getKey= > java/lang/IllegalStateException@ index B @ must have all shards allocated on the same node to shrink indexD
A? routing 2Lcom/groupbyinc/flux/cluster/routing/ShardRouting; numAllocations entries TLjava/util/Map$Entry; Ljava/util/Map$Entry; sourceIndex targetIndexMappingsTypes #Ljava/util/Set; targetIndexName targetIndexSettings sourceMetaData 4Lcom/groupbyinc/flux/cluster/metadata/IndexMetaData; table 7Lcom/groupbyinc/flux/cluster/routing/IndexRoutingTable; nodesToNumRouting NLjava/util/Map; Ljava/util/Map; numShards nodesToAllocateOn validateSplitIndex ?(Lcom/groupbyinc/flux/cluster/ClusterState;Ljava/lang/String;Ljava/util/Set;Ljava/lang/String;Lcom/groupbyinc/flux/common/settings/Settings;)V selectSplitShard a(ILcom/groupbyinc/flux/cluster/metadata/IndexMetaData;I)Lcom/groupbyinc/flux/index/shard/ShardId;]^
?_ getCreationVersion ()Lcom/groupbyinc/flux/Version;ab
?c com/groupbyinc/flux/Versione V_6_0_0_alpha1 Lcom/groupbyinc/flux/Version;gh fi before (Lcom/groupbyinc/flux/Version;)Zkl
fm Bsource index created version is too old to apply a split operationo 0com/groupbyinc/flux/index/IndexNotFoundExceptionq
r? blocks 3()Lcom/groupbyinc/flux/cluster/block/ClusterBlocks;tu
?v 3com/groupbyinc/flux/cluster/block/ClusterBlockLevelx WRITE 5Lcom/groupbyinc/flux/cluster/block/ClusterBlockLevel;z{ y| /com/groupbyinc/flux/cluster/block/ClusterBlocks~ indexBlocked J(Lcom/groupbyinc/flux/cluster/block/ClusterBlockLevel;Ljava/lang/String;)Z??
? A must be read-only to resize index. use "index.blocks.write=true"? size???? _default_? ? ?? ]mappings are not allowed when resizing indices, all mappings are copied from the source index? getRoutingFactor (II)I??
?? prepareResizeIndexSettings(Lcom/groupbyinc/flux/cluster/ClusterState;Ljava/util/Set;Lcom/groupbyinc/flux/common/settings/Settings$Builder;Lcom/groupbyinc/flux/index/Index;Ljava/lang/String;Lcom/groupbyinc/flux/action/admin/indices/shrink/ResizeType;ZLcom/groupbyinc/flux/common/settings/IndexScopedSettings;)V com/groupbyinc/flux/index/Index? getName? ?
?? :com/groupbyinc/flux/action/admin/indices/shrink/ResizeType? SHRINK