com.groupbyinc.flux.index.shard.ShardPath.class Maven / Gradle / Ivy
???? 4m )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; shardId )Lcom/groupbyinc/flux/index/shard/ShardId; shardStatePath isCustomDataPath Z $assertionsDisabled U(ZLjava/nio/file/Path;Ljava/nio/file/Path;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 - .
, / java/lang/Integer 1 (I)Ljava/lang/String; ' 3
2 4 java/lang/String 6 equals (Ljava/lang/Object;)Z 8 9
7 : java/lang/AssertionError < java/lang/StringBuilder >
? 0dataPath must end with the shard ID but didn't: A append -(Ljava/lang/String;)Ljava/lang/StringBuilder; C D
? E
? ) (Ljava/lang/Object;)V H
= I 6shardStatePath must end with the shard ID but didn't: K getParent M $ " N getIndex #()Lcom/groupbyinc/flux/index/Index; P Q
, R com/groupbyinc/flux/index/Index T getUUID V (
U W 1dataPath must end with index path id but didn't: Y 7shardStatePath must end with index path id but didn't: [ " : "java/lang/IllegalArgumentException ^ Pshard state path must be different to the data path when using custom data paths ` (Ljava/lang/String;)V b
_ c e g i k this +Lcom/groupbyinc/flux/index/shard/ShardPath; dataPath resolveTranslog resolve ((Ljava/lang/String;)Ljava/nio/file/Path; q r " s resolveIndex getDataPath exists ()Z java/nio/file/LinkOption y java/nio/file/Files { 2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z w }
| ~
getShardId +()Lcom/groupbyinc/flux/index/shard/ShardId; getShardStatePath getRootDataPath v $
? noIndexShardId getRootStatePath ? $
?
loadShardPath ?(Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/index/IndexSettings;)Lcom/groupbyinc/flux/index/shard/ShardPath; java/io/IOException ? 'com/groupbyinc/flux/index/IndexSettings ?
? W availableShardPaths @(Lcom/groupbyinc/flux/index/shard/ShardId;)[Ljava/nio/file/Path; ? ?
? 6com/groupbyinc/flux/common/apache/logging/log4j/Logger ? [Ljava/nio/file/Path; ? 2com/groupbyinc/flux/index/shard/ShardStateMetaData ? FORMAT 1Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; ? ? ? ? 9com/groupbyinc/flux/common/xcontent/NamedXContentRegistry ? EMPTY ;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry; ? ? ? ? /com/groupbyinc/flux/gateway/MetaDataStateFormat ? loadLatestState ?(Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;[Ljava/nio/file/Path;)Ljava/lang/Object; ? ?
? ? indexUUID ? ? ? _na_ ? ?{} 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 9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V ? ? ? ? java/lang/IllegalStateException ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder; C ?
? ? index UUID in shard state was: ? expected: ? on shard path: ?
? c more than one shard state found ? hasCustomDataPath ? x
? ? resolveCustomLocation h(Lcom/groupbyinc/flux/index/IndexSettings;Lcom/groupbyinc/flux/index/shard/ShardId;)Ljava/nio/file/Path; ? ?
? ){} loaded data path [{}], state path [{}] ? debug K(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V ? ? ? ?
? load 4Lcom/groupbyinc/flux/index/shard/ShardStateMetaData; statePath logger 8Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger; env )Lcom/groupbyinc/flux/env/NodeEnvironment;
indexSettings )Lcom/groupbyinc/flux/index/IndexSettings; paths
loadedPath deleteLeftoverShardDirectory ?(Lcom/groupbyinc/flux/common/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/env/ShardLock;Lcom/groupbyinc/flux/index/IndexSettings;)V !com/groupbyinc/flux/env/ShardLock ? ? ?
? ? D{} deleting leftover shard on path: [{}] with a different index UUID ? isDirectory ? }
| ? is not a directory ? acquireFSLockForPaths A(Lcom/groupbyinc/flux/index/IndexSettings;[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; selectNewPathForShard ?(Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/index/IndexSettings;JLjava/util/Map;)Lcom/groupbyinc/flux/index/shard/ShardPath; nodePaths 5()[Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath; ? ?
? ?(Lcom/groupbyinc/flux/index/shard/ShardId;)Ljava/nio/file/Path; q ?
? java/math/BigInteger ZERO Ljava/math/BigInteger;
java/util/Map 3[Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath; fileStore Ljava/nio/file/FileStore;
java/nio/file/FileStore getUsableSpace ()J
valueOf (J)Ljava/math/BigInteger;
add .(Ljava/math/BigInteger;)Ljava/math/BigInteger;
divide
max!
"? compareTo (Ljava/math/BigInteger;)I&'
(
= g get &(Ljava/lang/Object;)Ljava/lang/Object;,-. intValue0 .
21 multiply3
4 subtract6
7 nodePath 2Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath; usableBytes count Ljava/lang/Integer; totFreeSpace estShardSizeInBytes bestPath maxUsableBytes avgShardSizeInBytes J dataPathToShardCount 8Ljava/util/Map; Ljava/util/Map; getClass ()Ljava/lang/Class;GH
I
, : o Ljava/lang/Object; shardPath hashCodeO . "P
,P result I ShardPath{path=U , shard=W (C)Ljava/lang/StringBuilder; CY
?Z java/lang/Class] desiredAssertionStatus_ x
^`
ConstantValue Code LocalVariableTable LineNumberTable
StackMapTable
Exceptions LocalVariableTypeTable Signature ?(Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/index/IndexSettings;JLjava/util/Map;)Lcom/groupbyinc/flux/index/shard/ShardPath;
SourceFile InnerClasses 1 b b c ? 8*? ? ? <,? & ? * ? 0? 5? ;? #? =Y? ?Y? @B? F,? * ? F? G? J?? ? <-? & ? * ? 0? 5? ;? #? =Y? ?Y? @L? F,? * ? F? G? J?? ? A,? O ? & ? * ? S? X? ;? #? =Y? ?Y? @Z? F,? * ? F? G? J?? ? A-? O ? & ? * ? S? X? ;? #? =Y? ?Y? @\? F,? * ? F? G? J?? ,-? ] ?
? _Ya? d?*? f*,? h*? j*-? l? d 4 8 m n 8 8 o 8 8 e 2 - . C / ? 0 ? 1
2 3" 5' 6, 72 87 9f ? C " " , >? C? C p $ c 6 *? h? t ? d m n e <