com.groupbyinc.flux.gateway.MetaDataStateFormat.class Maven / Gradle / Ivy
???? 4? /com/groupbyinc/flux/gateway/MetaDataStateFormat (Ljava/lang/Object; java/lang/Object MetaDataStateFormat.java >com/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId PathAndStateId Icom/groupbyinc/flux/gateway/MetaDataStateFormat$StateIdAndLegacyPredicate
StateIdAndLegacyPredicate 1com/groupbyinc/flux/gateway/MetaDataStateFormat$2
1com/groupbyinc/flux/gateway/MetaDataStateFormat$1 $java/nio/file/DirectoryStream$Filter java/nio/file/DirectoryStream Filter %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup STATE_DIR_NAME Ljava/lang/String; _state STATE_FILE_EXTENSION .st STATE_FILE_CODEC state # !MIN_COMPATIBLE_STATE_FILE_VERSION I STATE_FILE_VERSION "STATE_FILE_VERSION_ES_2X_AND_BELOW BUFFER_SIZE format 2Lcom/groupbyinc/flux/common/xcontent/XContentType; prefix stateFilePattern Ljava/util/regex/Pattern; $assertionsDisabled Z G(Lcom/groupbyinc/flux/common/xcontent/XContentType;Ljava/lang/String;)V ()V 4 6
7 - . 9 / ; java/lang/StringBuilder =
> 7 java/util/regex/Pattern @ quote &(Ljava/lang/String;)Ljava/lang/String; B C
A D append -(Ljava/lang/String;)Ljava/lang/StringBuilder; F G
> H (\d+)( J )? L toString ()Ljava/lang/String; N O
> P compile -(Ljava/lang/String;)Ljava/util/regex/Pattern; R S
A T 0 1 V this 6Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; 1Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; 4()Lcom/groupbyinc/flux/common/xcontent/XContentType; write *(Ljava/lang/Object;[Ljava/nio/file/Path;)V java/io/IOException ^ java/lang/Throwable ` "java/lang/IllegalArgumentException b Locations must not be null d (Ljava/lang/String;)V 4 f
c g One or more locations required i findMaxStateId *(Ljava/lang/String;[Ljava/nio/file/Path;)J k l
m 2 3 o java/lang/AssertionError q &maxStateId must be positive but was: [ s (J)Ljava/lang/StringBuilder; F u
> v ] x (Ljava/lang/Object;)V 4 z
r { java/nio/file/Path } resolve ((Ljava/lang/String;)Ljava/nio/file/Path; ? ~ ? %java/nio/file/attribute/FileAttribute ? java/nio/file/Files ? createDirectories R(Ljava/nio/file/Path;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path; ? ?
? ? .tmp ? MetaDataStateFormat.write(path=" ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder; F ?
> ? ") ? Fcom/groupbyinc/flux/common/apache/lucene/store/OutputStreamIndexOutput ? java/nio/file/OpenOption ? newOutputStream G(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/OutputStream; ? ?
? ? >(Ljava/lang/String;Ljava/lang/String;Ljava/io/OutputStream;I)V 4 ?
? ? 9com/groupbyinc/flux/common/apache/lucene/codecs/CodecUtil ? writeHeader Q(Lcom/groupbyinc/flux/common/apache/lucene/store/DataOutput;Ljava/lang/String;I)V ? ?
? ? 0com/groupbyinc/flux/common/xcontent/XContentType ? index ()I ? ?
? ? writeInt (I)V ? ?
? ? p(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat;Lcom/groupbyinc/flux/common/apache/lucene/store/IndexOutput;)V 4 ?
? newXContentBuilder (Lcom/groupbyinc/flux/common/xcontent/XContentType;Ljava/io/OutputStream;)Lcom/groupbyinc/flux/common/xcontent/XContentBuilder; ? ?
? 3com/groupbyinc/flux/common/xcontent/XContentBuilder ? startObject 7()Lcom/groupbyinc/flux/common/xcontent/XContentBuilder; ? ?
? ?
toXContent J(Lcom/groupbyinc/flux/common/xcontent/XContentBuilder;Ljava/lang/Object;)V ? ?
? endObject ? ?
? ? close ? 6
? ? [Ljava/nio/file/Path; ? java/lang/String ?
addSuppressed (Ljava/lang/Throwable;)V ? ?
a ? writeFooter ?(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexOutput;)V ? ?
? ?
? ? 5com/groupbyinc/flux/common/apache/lucene/util/IOUtils ? fsync (Ljava/nio/file/Path;Z)V ? ?
? ? java/nio/file/CopyOption ? java/nio/file/StandardCopyOption ? ATOMIC_MOVE "Ljava/nio/file/StandardCopyOption; ? ? ? ? move Y(Ljava/nio/file/Path;Ljava/nio/file/Path;[Ljava/nio/file/CopyOption;)Ljava/nio/file/Path; ? ?
? ? copy ? ?
? ? deleteIfExists (Ljava/nio/file/Path;)Z ? ?
? ? cleanupOldFiles <(Ljava/lang/String;Ljava/lang/String;[Ljava/nio/file/Path;)V ? ?
? builder 5Lcom/groupbyinc/flux/common/xcontent/XContentBuilder; out HLcom/groupbyinc/flux/common/apache/lucene/store/OutputStreamIndexOutput; tmpPath Ljava/nio/file/Path; finalPath i resourceDesc TT; Ljava/lang/Object; locations
maxStateId J fileName
stateLocation tmpStatePath finalStatePath 3com/groupbyinc/flux/common/xcontent/XContentFactory contentBuilder ?
type stream Ljava/io/OutputStream; fromXContent H(Lcom/groupbyinc/flux/common/xcontent/XContentParser;)Ljava/lang/Object; read c(Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;Ljava/nio/file/Path;)Ljava/lang/Object; Dcom/groupbyinc/flux/common/apache/lucene/index/CorruptIndexException Icom/groupbyinc/flux/common/apache/lucene/index/IndexFormatTooOldException Icom/groupbyinc/flux/common/apache/lucene/index/IndexFormatTooNewException getParent ()Ljava/nio/file/Path; ~ newDirectory P(Ljava/nio/file/Path;)Lcom/groupbyinc/flux/common/apache/lucene/store/Directory;
getFileName ~ ~ P 8com/groupbyinc/flux/common/apache/lucene/store/IOContext DEFAULT :Lcom/groupbyinc/flux/common/apache/lucene/store/IOContext;"# !$ 8com/groupbyinc/flux/common/apache/lucene/store/Directory& openInput ?(Ljava/lang/String;Lcom/groupbyinc/flux/common/apache/lucene/store/IOContext;)Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;()
'* checksumEntireFile >(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;)J,-
?. checkHeader Q(Lcom/groupbyinc/flux/common/apache/lucene/store/DataInput;Ljava/lang/String;II)I01
?2 values 5()[Lcom/groupbyinc/flux/common/xcontent/XContentType;45
?6 9com/groupbyinc/flux/common/apache/lucene/store/IndexInput8 readInt: ?
9; readLong ()J=>
9? 9com/groupbyinc/flux/common/xcontent/NamedXContentRegistryA getFilePointerC>
9D lengthF>
9G footerLengthI ?
?J state_xcontentL slice Q(Ljava/lang/String;JJ)Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;NO
9P xContent b(Lcom/groupbyinc/flux/common/xcontent/XContentType;)Lcom/groupbyinc/flux/common/xcontent/XContent;RS
T =com/groupbyinc/flux/common/lucene/store/InputStreamIndexInputV ?(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;J)V 4X
WY ,com/groupbyinc/flux/common/xcontent/XContent[ createParser ?(Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;Ljava/io/InputStream;)Lcom/groupbyinc/flux/common/xcontent/XContentParser;]^\_
a 2com/groupbyinc/flux/common/xcontent/XContentParsercd ?
9 ?
' ? 1com/groupbyinc/flux/gateway/CorruptStateExceptionh 4 ?
ij parser 4Lcom/groupbyinc/flux/common/xcontent/XContentParser; ;Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput; fileVersion xContentType filePointer contentSize
indexInput ex Ljava/io/IOException; dir :Lcom/groupbyinc/flux/common/apache/lucene/store/Directory; namedXContentRegistry ;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry; file @com/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectory{ (Ljava/nio/file/Path;)V 4}
|~ X(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat;Ljava/lang/String;Ljava/lang/String;)V 4?
? newDirectoryStream [(Ljava/nio/file/Path;Ljava/nio/file/DirectoryStream$Filter;)Ljava/nio/file/DirectoryStream;??
?? iterator ()Ljava/util/Iterator;?? ? java/util/Iterator? hasNext ()Z???? next ()Ljava/lang/Object;???? ? stateFile 5Ljava/nio/file/DirectoryStream; Ljava/nio/file/DirectoryStream; dataLocation currentStateFile filter ; &Ljava/nio/file/DirectoryStream$Filter;???????? java/nio/file/LinkOption? exists 2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z??
?? *? G(Ljava/nio/file/Path;Ljava/lang/String;)Ljava/nio/file/DirectoryStream;??
?? matcher 3(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;??
A? java/util/regex/Matcher? matches??
?? group (I)Ljava/lang/String;??
?? java/lang/Long? parseLong (Ljava/lang/String;)J??
?? java/lang/Math? max (JJ)J??
?? id Ljava/util/regex/Matcher; maxId loadLatestState ?(Lorg/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;[Ljava/nio/file/Path;)Ljava/lang/Object; !java/nio/file/NoSuchFileException? java/io/FileNotFoundException? java/lang/Exception? java/util/ArrayList?
? 7 org/apache/logging/log4j/Logger? java/util/List? 5(Ljava/nio/file/Path;)Ljava/nio/file/DirectoryStream;??
?? equals (Ljava/lang/Object;)Z??
?? L(Ljava/nio/file/Path;JZLcom/groupbyinc/flux/gateway/MetaDataStateFormat$1;)V 4?
? found state file: {}? trace '(Ljava/lang/String;Ljava/lang/Object;)V???? add???? ()Ljava/util/stream/Stream;??? (JZ)V 4?
? java/util/stream/Stream? 9(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;???? "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;??
????? ()Ljava/util/ArrayList;? get ()Ljava/util/function/Supplier;? java/util/stream/Collectors toCollection ;(Ljava/util/function/Supplier;)Ljava/util/stream/Collector;
collect 0(Ljava/util/stream/Collector;)Ljava/lang/Object;
? java/util/Collection
?z ? ? ? legacy 3 readAllBytes (Ljava/nio/file/Path;)[B
? !{}: no data for [{}], ignoring... toAbsolutePath ~ debug 9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V !?" [B$ +com/groupbyinc/flux/common/bytes/BytesArray& ([B)V 4(
') 2com/groupbyinc/flux/common/xcontent/XContentHelper+ ?(Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;Lcom/groupbyinc/flux/common/bytes/BytesReference;)Lcom/groupbyinc/flux/common/xcontent/XContentParser;]-
,.
0 state id [{}] read from [{}]2 valueOf (J)Ljava/lang/Long;45
?6?!?8 failed to read :
P *(Ljava/lang/String;Ljava/lang/Throwable;)V 4=
_> lambda$loadLatestState$0 T(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId;)Ljava/lang/Object;@A
BC ?(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat;Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId;)Lorg/apache/logging/log4j/util/Supplier;?E F @(Lorg/apache/logging/log4j/util/Supplier;Ljava/lang/Throwable;)V H?I $com/groupbyinc/flux/ExceptionsHelperK maybeThrowRuntimeAndSuppress (Ljava/util/List;)VMN
LO sizeQ ??R java/lang/IllegalStateExceptionT 2Could not find a state file to recover from among V
U g stateId pav @Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId; paths stateDir data e Ljava/lang/Exception; pathAndStateId logger !Lorg/apache/logging/log4j/Logger;
dataLocations files RLjava/util/List; Ljava/util/List; maxStateIdIsLegacy
exceptions 'Ljava/util/List; pathAndStateIds XLjava/util/Collection; Ljava/util/Collection; deleteMetaState ([Ljava/nio/file/Path;)V rmpo
?q stateDirectories 5org/apache/logging/log4j/message/ParameterizedMessaget ${}: failed to read [{}], ignoring...v 4!
ux java/lang/Class{ desiredAssertionStatus}?
|~
ConstantValue Code LocalVariableTable LocalVariableTypeTable LineNumberTable
StackMapTable
Exceptions Signature (TT;[Ljava/nio/file/Path;)V ;(Lcom/groupbyinc/flux/common/xcontent/XContentBuilder;TT;)V 9(Lcom/groupbyinc/flux/common/xcontent/XContentParser;)TT; T(Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;Ljava/nio/file/Path;)TT; v(Lorg/apache/logging/log4j/Logger;Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;[Ljava/nio/file/Path;)TT; BootstrapMethods
SourceFile InnerClasses! ? ? ! " ? $ % &