
com.groupbyinc.flux.index.shard.ShardPath.class Maven / Gradle / Ivy
???? 3? )com/groupbyinc/flux/index/shard/ShardPath java/lang/Object ShardPath.java 0com/groupbyinc/flux/env/NodeEnvironment$NodePath 'com/groupbyinc/flux/env/NodeEnvironment NodePath INDEX_FOLDER_NAME Ljava/lang/String; index
TRANSLOG_FOLDER_NAME translog path Ljava/nio/file/Path; indexUUID shardId )Lcom/groupbyinc/flux/index/shard/ShardId; shardStatePath isCustomDataPath Z $assertionsDisabled g(ZLjava/nio/file/Path;Ljava/nio/file/Path;Ljava/lang/String;Lcom/groupbyinc/flux/index/shard/ShardId;)V ()V
java/nio/file/Path " getFileName ()Ljava/nio/file/Path; $ % # & toString ()Ljava/lang/String; ( ) # * 'com/groupbyinc/flux/index/shard/ShardId , id ()I . /
- 0 java/lang/Integer 2 (I)Ljava/lang/String; ( 4
3 5 java/lang/String 7 equals (Ljava/lang/Object;)Z 9 :
8 ; java/lang/AssertionError = java/lang/StringBuilder ?
@ 0dataPath must end with the shard ID but didn't: B append -(Ljava/lang/String;)Ljava/lang/StringBuilder; D E
@ F
@ * (Ljava/lang/Object;)V I
> J 6shardStatePath must end with the shard ID but didn't: L getParent N % # O getIndex Q )
- R 1dataPath must end with index/shardID but didn't: T 7shardStatePath must end with index/shardID but didn't: V # ; "java/lang/IllegalArgumentException Y Pshard state path must be different to the data path when using custom data paths [ (Ljava/lang/String;)V ]
Z ^ ` b d f h this +Lcom/groupbyinc/flux/index/shard/ShardPath; dataPath resolveTranslog resolve ((Ljava/lang/String;)Ljava/nio/file/Path; n o # p resolveIndex getDataPath exists ()Z java/nio/file/LinkOption v java/nio/file/Files x 2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z t z
y { getIndexUUID
getShardId +()Lcom/groupbyinc/flux/index/shard/ShardId; getShardStatePath getRootDataPath s %
? noIndexShardId getRootStatePath ? %
?
loadShardPath ?(Lcom/groupbyinc/flux/common/logging/ESLogger;Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/common/settings/Settings;)Lcom/groupbyinc/flux/index/shard/ShardPath; java/io/IOException ?
index.uuid ? _na_ ? ,com/groupbyinc/flux/common/settings/Settings ? get 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ? ?
? ? availableShardPaths @(Lcom/groupbyinc/flux/index/shard/ShardId;)[Ljava/nio/file/Path; ? ?
? +com/groupbyinc/flux/common/logging/ESLogger ? [Ljava/nio/file/Path; ? 2com/groupbyinc/flux/index/shard/ShardStateMetaData ? FORMAT 1Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; ? ? ? ? /com/groupbyinc/flux/gateway/MetaDataStateFormat ? loadLatestState V(Lcom/groupbyinc/flux/common/logging/ESLogger;[Ljava/nio/file/Path;)Ljava/lang/Object; ? ?
? ? ? d ?{} found shard on path: [{}] with a different index UUID - this shard seems to be leftover from a different index with the same name. Remove the leftover shard in order to reuse the path with the current index ? warn ((Ljava/lang/String;[Ljava/lang/Object;)V ? ? ? ? java/lang/IllegalStateException ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder; D ?
@ ? index UUID in shard state was: ? expected: ? on shard path: ?
? ^ more than one shard state found ? hasCustomDataPath 1(Lcom/groupbyinc/flux/common/settings/Settings;)Z ? ?
? resolveCustomLocation m(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/index/shard/ShardId;)Ljava/nio/file/Path; ? ?
? ){} loaded data path [{}], state path [{}] ? debug ? ? ? ?
? load 4Lcom/groupbyinc/flux/index/shard/ShardStateMetaData; statePath logger -Lcom/groupbyinc/flux/common/logging/ESLogger; env )Lcom/groupbyinc/flux/env/NodeEnvironment;
indexSettings .Lcom/groupbyinc/flux/common/settings/Settings; paths
loadedPath deleteLeftoverShardDirectory ?(Lcom/groupbyinc/flux/common/logging/ESLogger;Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/env/ShardLock;Lcom/groupbyinc/flux/common/settings/Settings;)V !com/groupbyinc/flux/env/ShardLock ? ~
? ? D{} deleting leftover shard on path: [{}] with a different index UUID ? isDirectory ? z
y ? is not a directory ? acquireFSLockForPaths F(Lcom/groupbyinc/flux/common/settings/Settings;[Ljava/nio/file/Path;)V ? ?
? 5com/groupbyinc/flux/common/apache/lucene/util/IOUtils ? rm ([Ljava/nio/file/Path;)V ? ?
? ? lock #Lcom/groupbyinc/flux/env/ShardLock; getEstimatedReservedBytes O(Lcom/groupbyinc/flux/env/NodeEnvironment;JLjava/lang/Iterable;)Ljava/util/Map; nodePaths 5()[Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath; ? ?
? java/lang/Iterable ? 3[Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath; ? fileStore Ljava/nio/file/FileStore; ? ? ? java/nio/file/FileStore getUsableSpace ()J
@4 java/lang/Math max (JJ)J
java/util/HashMap
iterator ()Ljava/util/Iterator; ?
java/util/Map java/util/Iterator hasNext u next ()Ljava/lang/Object; *com/groupbyinc/flux/index/shard/IndexShard shardPath -()Lcom/groupbyinc/flux/index/shard/ShardPath;"#
!$ shardStatePathToDataPath *(Ljava/nio/file/Path;)Ljava/nio/file/Path;&'
( &(Ljava/lang/Object;)Ljava/lang/Object; ?*+ java/lang/Long- valueOf (J)Ljava/lang/Long;/0
.1 longValue3
.4 put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;678 nodePath 2Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath; curBytes Ljava/lang/Long; shard ,Lcom/groupbyinc/flux/index/shard/IndexShard; avgShardSizeInBytes J shards BLjava/lang/Iterable; Ljava/lang/Iterable; totFreeSpace estShardSizeInBytes
reservedBytes 5Ljava/util/Map; Ljava/util/Map; selectNewPathForShard ?(Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/common/settings/Settings;JLjava/util/Map;)Lcom/groupbyinc/flux/index/shard/ShardPath; ?(Lcom/groupbyinc/flux/index/shard/ShardId;)Ljava/nio/file/Path; nL
M? b intValueR /
3S usableBytes count Ljava/lang/Integer; bestPath maxUsableBytes dataPathToShardCount 8Ljava/util/Map; getClass ()Ljava/lang/Class;\]
^
- ; o Ljava/lang/Object; hashCodec / #d
8d
-d result I ShardPath{path=j
, indexUUID='l (C)Ljava/lang/StringBuilder; Dn
@o , shard=q java/lang/Classt desiredAssertionStatusv u
uw
ConstantValue Code LocalVariableTable LineNumberTable
StackMapTable
Exceptions LocalVariableTypeTable Signature ?(Lcom/groupbyinc/flux/env/NodeEnvironment;JLjava/lang/Iterable;)Ljava/util/Map; ?(Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/common/settings/Settings;JLjava/util/Map;)Lcom/groupbyinc/flux/index/shard/ShardPath;
SourceFile InnerClasses 1 y y z ? 8*? ? !? <,? ' ? + ? 1? 6?