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 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 FORMAT 2Lcom/groupbyinc/flux/common/xcontent/XContentType; STATE_DIR_NAME Ljava/lang/String; _state STATE_FILE_EXTENSION .st STATE_FILE_CODEC state !MIN_COMPATIBLE_STATE_FILE_VERSION I STATE_FILE_VERSION BUFFER_SIZE prefix stateFilePattern Ljava/util/regex/Pattern; logger !Lorg/apache/logging/log4j/Logger; $assertionsDisabled Z (Ljava/lang/String;)V ()V / 1
2 ( 4 java/lang/StringBuilder 6
7 2 java/util/regex/Pattern 9 quote &(Ljava/lang/String;)Ljava/lang/String; ; <
: = append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? @
7 A (\d+)( C )? E toString ()Ljava/lang/String; G H
7 I compile -(Ljava/lang/String;)Ljava/util/regex/Pattern; K L
: M ) * O this 6Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; 1Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; write *(Ljava/lang/Object;[Ljava/nio/file/Path;)V java/io/IOException V java/lang/Throwable X "java/lang/IllegalArgumentException Z Locations must not be null \ / 0
[ ^ One or more locations required ` findMaxStateId *(Ljava/lang/String;[Ljava/nio/file/Path;)J b c
d - . f java/lang/AssertionError h &maxStateId must be positive but was: [ j (J)Ljava/lang/StringBuilder; ? l
7 m ] o (Ljava/lang/Object;)V / q
i r java/nio/file/Path t resolve ((Ljava/lang/String;)Ljava/nio/file/Path; v w u x %java/nio/file/attribute/FileAttribute z 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; ? ?
7 ? ") ? 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 / ?
? ? 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 / ?
? 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 ? ?
? ? $closeResource 1(Ljava/lang/Throwable;Ljava/lang/AutoCloseable;)V ? ?
? [Ljava/nio/file/Path; ? java/lang/String ? writeFooter ?(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexOutput;)V ? ?
? ? ,com/groupbyinc/flux/core/internal/io/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; ? ?
} ? + , ? written state to {} ? org/apache/logging/log4j/Logger ? trace '(Ljava/lang/String;Ljava/lang/Object;)V ? ? ? ? copy ? ?
} ? copied state to {} ? deleteIfExists (Ljava/nio/file/Path;)Z ? ?
} ?
cleaned up {} ? 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; u newDirectory P(Ljava/nio/file/Path;)Lcom/groupbyinc/flux/common/apache/lucene/store/Directory;
getFileName u u I 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/0
?1 checkHeader Q(Lcom/groupbyinc/flux/common/apache/lucene/store/DataInput;Ljava/lang/String;II)I34
?5 values 5()[Lcom/groupbyinc/flux/common/xcontent/XContentType;78
?9 9com/groupbyinc/flux/common/apache/lucene/store/IndexInput; readInt= ?
<> java/lang/IllegalStateException@ expected state in B to be D format but was F
A ^ 9com/groupbyinc/flux/common/xcontent/NamedXContentRegistryI getFilePointer ()JKL
<M lengthOL
<P footerLengthR ?
?S state_xcontentU slice Q(Ljava/lang/String;JJ)Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;WX
<Y xContent b(Lcom/groupbyinc/flux/common/xcontent/XContentType;)Lcom/groupbyinc/flux/common/xcontent/XContent;[\
] =com/groupbyinc/flux/common/xcontent/LoggingDeprecationHandler_ INSTANCE ?Lcom/groupbyinc/flux/common/xcontent/LoggingDeprecationHandler;ab `c =com/groupbyinc/flux/common/lucene/store/InputStreamIndexInpute ?(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;J)V /g
fh ,com/groupbyinc/flux/common/xcontent/XContentj createParser ?(Lcom/groupbyinc/flux/common/xcontent/NamedXContentRegistry;Lcom/groupbyinc/flux/common/xcontent/DeprecationHandler;Ljava/io/InputStream;)Lcom/groupbyinc/flux/common/xcontent/XContentParser;lmkn
p 2com/groupbyinc/flux/common/xcontent/XContentParserr 1com/groupbyinc/flux/gateway/CorruptStateExceptiont (Ljava/lang/Throwable;)V /v
uw parser 4Lcom/groupbyinc/flux/common/xcontent/XContentParser; ;Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput; 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 /?
?? "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/lang/Object;)Z? lambda$cleanupOldFiles$0 ;(Ljava/lang/String;Ljava/lang/String;Ljava/nio/file/Path;)Z??
?? ? accept L(Ljava/lang/String;Ljava/lang/String;)Ljava/nio/file/DirectoryStream$Filter;?? ? cleanupOldFiles: cleaning up {}? 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;???? cleanupOldFiles: cleaned up {}? 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;??
:? 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?
? 2 java/util/List? 5(Ljava/nio/file/Path;)Ljava/nio/file/DirectoryStream;??
}? K(Ljava/nio/file/Path;JLcom/groupbyinc/flux/gateway/MetaDataStateFormat$1;)V /?
? found state file: {}? add???? ()Ljava/util/stream/Stream;??? lambda$loadLatestState$1 D(JLcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId;)Z
C(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId;)Z test !(J)Ljava/util/function/Predicate;
java/util/stream/Stream 9(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;?
?? ()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#$?? ? &
( state id [{}] read from [{}]*? , valueOf (J)Ljava/lang/Long;./
?0 9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V ?2 ?3 failed to read 5
I *(Ljava/lang/String;Ljava/lang/Throwable;)V /8
W9 ,()Lorg/apache/logging/log4j/message/Message;; lambda$loadLatestState$2 l(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId;)Lorg/apache/logging/log4j/message/Message;=>
?@ ?(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat;Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId;)Lorg/apache/logging/log4j/util/MessageSupplier;B C debug G(Lorg/apache/logging/log4j/util/MessageSupplier;Ljava/lang/Throwable;)VEF ?G $com/groupbyinc/flux/ExceptionsHelperI maybeThrowRuntimeAndSuppress (Ljava/util/List;)VKL
JM sizeO ??P 2Could not find a state file to recover from among R stateId pav @Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId; paths stateDir e Ljava/lang/Exception; pathAndStateId
dataLocations files RLjava/util/List; Ljava/util/List; finalMaxStateId pathAndStateIds XLjava/util/Collection; Ljava/util/Collection;
exceptions 'Ljava/util/List; deleteMetaState ([Ljava/nio/file/Path;)V rmhg
?i stateDirectories 5org/apache/logging/log4j/message/ParameterizedMessagel ${}: failed to read [{}], ignoring...n toAbsolutePathp uq /2
ms
isRegularFileu?
}v
startsWith (Ljava/lang/String;)Zxy
?z equals|?
?} entry
entryFileName java/lang/AutoCloseable? close? 1??
addSuppressed?v
Y? x0 Ljava/lang/Throwable; x1 Ljava/lang/AutoCloseable; java/lang/Class? desiredAssertionStatus??
?? SMILE? ?? *com/groupbyinc/flux/common/logging/Loggers? getLogger 4(Ljava/lang/Class;)Lorg/apache/logging/log4j/Logger;??
??
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! ? ? ? ! " # ? $ % # ? $ &