
com.groupbyinc.flux.gateway.MetaDataStateFormat.class Maven / Gradle / Ivy
???? 3Z /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 STATE_DIR_NAME Ljava/lang/String; _state STATE_FILE_EXTENSION .st STATE_FILE_CODEC state STATE_FILE_VERSION I 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 , .
/ % & 1 ' 3 java/lang/StringBuilder 5
6 / java/util/regex/Pattern 8 quote &(Ljava/lang/String;)Ljava/lang/String; : ;
9 < append -(Ljava/lang/String;)Ljava/lang/StringBuilder; > ?
6 @ (\d+)( B )? D toString ()Ljava/lang/String; F G
6 H compile -(Ljava/lang/String;)Ljava/util/regex/Pattern; J K
9 L ( ) N this 6Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; 1Lcom/groupbyinc/flux/gateway/MetaDataStateFormat; 4()Lcom/groupbyinc/flux/common/xcontent/XContentType; write +(Ljava/lang/Object;J[Ljava/nio/file/Path;)V java/io/IOException V java/lang/Throwable X Locations must not be null Z ;com/groupbyinc/flux/common/google/common/base/Preconditions \
checkArgument (ZLjava/lang/Object;)V ^ _
] ` One or more locations required b findMaxStateId *(Ljava/lang/String;[Ljava/nio/file/Path;)J d e
f * + h java/lang/AssertionError j &maxStateId must be positive but was: [ l (J)Ljava/lang/StringBuilder; > n
6 o ] q (Ljava/lang/Object;)V , s
k t java/nio/file/Path v resolve ((Ljava/lang/String;)Ljava/nio/file/Path; x y w z %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; > ?
6 ? ") ? 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/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 ? ?
? ? writeLong (J)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 ? ?
? ? close ? .
? ? [Ljava/nio/file/Path; ? java/lang/String ?
addSuppressed (Ljava/lang/Throwable;)V ? ?
Y ? 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; version J locations
maxStateId 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 ((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; w newDirectory P(Ljava/nio/file/Path;)Lcom/groupbyinc/flux/common/apache/lucene/store/Directory;
getFileName w w H 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)I./
?0 values 5()[Lcom/groupbyinc/flux/common/xcontent/XContentType;23
?4 9com/groupbyinc/flux/common/apache/lucene/store/IndexInput6 readInt8 ?
79 readLong ()J;<
7= getFilePointer?<
7@ lengthB<
7C footerLengthE ?
?F state_xcontentH slice Q(Ljava/lang/String;JJ)Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;JK
7L xContent b(Lcom/groupbyinc/flux/common/xcontent/XContentType;)Lcom/groupbyinc/flux/common/xcontent/XContent;NO
P =com/groupbyinc/flux/common/lucene/store/InputStreamIndexInputR ?(Lcom/groupbyinc/flux/common/apache/lucene/store/IndexInput;J)V ,T
SU ,com/groupbyinc/flux/common/xcontent/XContentW createParser K(Ljava/io/InputStream;)Lcom/groupbyinc/flux/common/xcontent/XContentParser;YZX[
] 2com/groupbyinc/flux/common/xcontent/XContentParser_` ?
7 ?
% ? 1com/groupbyinc/flux/gateway/CorruptStateExceptiond , ?
ef 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; file @com/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectoryt (Ljava/nio/file/Path;)V ,v
uw X(Lcom/groupbyinc/flux/gateway/MetaDataStateFormat;Ljava/lang/String;Ljava/lang/String;)V ,y
z 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;??
9? 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 V(Lcom/groupbyinc/flux/common/logging/ESLogger;[Ljava/nio/file/Path;)Ljava/lang/Object; !java/nio/file/NoSuchFileException? java/io/FileNotFoundException? java/util/ArrayList?
? / +com/groupbyinc/flux/common/logging/ESLogger? 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 ,?
? found state file: {}? trace ((Ljava/lang/String;[Ljava/lang/Object;)V???? add???? (JZ)V ,?
? =com/groupbyinc/flux/common/google/common/collect/Collections2? g(Ljava/util/Collection;Lcom/groupbyinc/flux/common/google/common/base/Predicate;)Ljava/util/Collection;??
?? java/util/Collection???s ? ?? ? ? legacy? + ? readAllBytes (Ljava/nio/file/Path;)[B??
? !{}: no data for [{}], ignoring...? toAbsolutePath? w? debug???? [B? +com/groupbyinc/flux/common/bytes/BytesArray ([B)V ,
2com/groupbyinc/flux/common/xcontent/XContentHelper g(Lcom/groupbyinc/flux/common/bytes/BytesReference;)Lcom/groupbyinc/flux/common/xcontent/XContentParser;Y
state id [{}] read from [{}] valueOf (J)Ljava/lang/Long;
? failed to read
H *(Ljava/lang/String;Ljava/lang/Throwable;)V ,
W ${}: failed to read [{}], ignoring... =(Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V?? $com/groupbyinc/flux/ExceptionsHelper maybeThrowRuntimeAndSuppress (Ljava/util/List;)V
! size# ??$ java/lang/IllegalStateException& 2Could not find a state file to recover from among ( (Ljava/lang/String;)V ,*
'+ stateId pav @Lcom/groupbyinc/flux/gateway/MetaDataStateFormat$PathAndStateId; paths stateDir data e Ljava/lang/Throwable; pathAndStateId logger -Lcom/groupbyinc/flux/common/logging/ESLogger;
dataLocations files RLjava/util/List; Ljava/util/List; maxStateIdIsLegacy
exceptions 'Ljava/util/List; deleteMetaState ([Ljava/nio/file/Path;)V rmA@
?B stateDirectories java/lang/ClassF desiredAssertionStatusH?
GI
ConstantValue Code LocalVariableTable LocalVariableTypeTable LineNumberTable
StackMapTable
Exceptions Signature (TT;J[Ljava/nio/file/Path;)V ;(Lcom/groupbyinc/flux/common/xcontent/XContentBuilder;TT;)V 9(Lcom/groupbyinc/flux/common/xcontent/XContentParser;)TT; (Ljava/nio/file/Path;)TT; G(Lcom/groupbyinc/flux/common/logging/ESLogger;[Ljava/nio/file/Path;)TT;
SourceFile InnerClasses! K K K ! K " # ! K $ % &