com.groupbyinc.flux.index.translog.TranslogWriter.class Maven / Gradle / Ivy
???? 4? 1com/groupbyinc/flux/index/translog/TranslogWriter 5com/groupbyinc/flux/index/translog/BaseTranslogReader java/io/Closeable TranslogWriter.java Mcom/groupbyinc/flux/index/translog/TranslogWriter$BufferedChannelOutputStream BufferedChannelOutputStream 4com/groupbyinc/flux/index/translog/Translog$Location +com/groupbyinc/flux/index/translog/Translog
Location 1com/groupbyinc/flux/index/translog/Translog$Index Index 2com/groupbyinc/flux/index/translog/Translog$Delete Delete 5com/groupbyinc/flux/index/translog/Translog$Operation Operation java/util/Map$Entry
java/util/Map Entry %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup shardId )Lcom/groupbyinc/flux/index/shard/ShardId; channelFactory 3Lcom/groupbyinc/flux/index/translog/ChannelFactory; lastSyncedCheckpoint /Lcom/groupbyinc/flux/index/translog/Checkpoint; operationCounter I tragedy Ljava/lang/Exception; outputStream Ljava/io/OutputStream; totalOffset J minSeqNo maxSeqNo globalCheckpointSupplier !Ljava/util/function/LongSupplier; minTranslogGenerationSupplier closed +Ljava/util/concurrent/atomic/AtomicBoolean; syncLock Ljava/lang/Object; seenSequenceNumbers Ljava/util/Map; ?Ljava/util/Map;>; $assertionsDisabled Z e(Lcom/groupbyinc/flux/index/translog/ChannelFactory;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/index/translog/Checkpoint;Ljava/nio/channels/FileChannel;Ljava/nio/file/Path;Lcom/groupbyinc/flux/common/unit/ByteSizeValue;Ljava/util/function/LongSupplier;Ljava/util/function/LongSupplier;Lcom/groupbyinc/flux/index/translog/TranslogHeader;)V java/io/IOException A -com/groupbyinc/flux/index/translog/Checkpoint C
generation E 0 D F j(JLjava/nio/channels/FileChannel;Ljava/nio/file/Path;Lcom/groupbyinc/flux/index/translog/TranslogHeader;)V ? H
I )java/util/concurrent/atomic/AtomicBoolean K (Z)V ? M
L N 6 7 P java/lang/Object R ()V ? T
S U 8 9 W = > Y offset [ 0 D \ java/nio/channels/FileChannel ^ position ()J ` a
_ b java/lang/AssertionError d java/lang/StringBuilder f
g U initial checkpoint offset [ i append -(Ljava/lang/String;)Ljava/lang/StringBuilder; k l
g m (J)Ljava/lang/StringBuilder; k o
g p .] is different than current channel position [ r ] t toString ()Ljava/lang/String; v w
g x (Ljava/lang/Object;)V ? z
e { 1com/groupbyinc/flux/index/translog/ChannelFactory } 'com/groupbyinc/flux/index/shard/ShardId java/nio/file/Path ? -com/groupbyinc/flux/common/unit/ByteSizeValue ? java/util/function/LongSupplier ? 1com/groupbyinc/flux/index/translog/TranslogHeader ? # $ ? % & ? 5 4 ? java/nio/channels/Channels ? newOutputStream ?(Ljava/nio/channels/WritableByteChannel;)Ljava/io/OutputStream; ? ?
? ?
bytesAsInt ()I ? ?
? ? M(Lcom/groupbyinc/flux/index/translog/TranslogWriter;Ljava/io/OutputStream;I)V ? ?
? - . ? ' ( ? / 0 ? 1 0 D ????????? (J)V ? ?
e ? ? 2 0 D ? ? trimmedAboveSeqNo ? 0 D ????????? 3 4 ? com/groupbyinc/flux/Assertions ? ENABLED ? > ? ? java/util/HashMap ?
? U : ; ? this 3Lcom/groupbyinc/flux/index/translog/TranslogWriter; initialCheckpoint channel Ljava/nio/channels/FileChannel; path Ljava/nio/file/Path;
bufferSize /Lcom/groupbyinc/flux/common/unit/ByteSizeValue; header 3Lcom/groupbyinc/flux/index/translog/TranslogHeader; create,(Lcom/groupbyinc/flux/index/shard/ShardId;Ljava/lang/String;JLjava/nio/file/Path;Lcom/groupbyinc/flux/index/translog/ChannelFactory;Lcom/groupbyinc/flux/common/unit/ByteSizeValue;JJLjava/util/function/LongSupplier;Ljava/util/function/LongSupplier;J)Lcom/groupbyinc/flux/index/translog/TranslogWriter; java/lang/Exception ? open 5(Ljava/nio/file/Path;)Ljava/nio/channels/FileChannel; ? ? ~ ? (Ljava/lang/String;J)V ? ?
? ? write "(Ljava/nio/channels/FileChannel;)V ? ?
? ? sizeInBytes ? ?
? ? emptyTranslogCheckpoint 5(JJJJ)Lcom/groupbyinc/flux/index/translog/Checkpoint; ? ?
D ? getParent ()Ljava/nio/file/Path; ? ? ? ? writeCheckpoint y(Lcom/groupbyinc/flux/index/translog/ChannelFactory;Ljava/nio/file/Path;Lcom/groupbyinc/flux/index/translog/Checkpoint;)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; ? ?
? ? ? a lambda$create$0 %(Ljava/util/function/LongSupplier;J)J ? ?
? ? getAsLong E(Ljava/util/function/LongSupplier;J)Ljava/util/function/LongSupplier; ? ? ? ? @
? java/lang/String ? ,com/groupbyinc/flux/core/internal/io/IOUtils ? closeWhileHandlingException ([Ljava/io/Closeable;)V ? ?
? writerGlobalCheckpointSupplier
checkpoint exception translogUUID Ljava/lang/String; fileGeneration file initialMinTranslogGen initialGlobalCheckpoint primaryTerm getTragicException ()Ljava/lang/Exception; + , closeWithTragicEvent (Ljava/lang/Exception;)V java/lang/RuntimeException
e U
addSuppressed (Ljava/lang/Throwable;)V
? close T
e ex add j(Lcom/groupbyinc/flux/common/bytes/BytesReference;J)Lcom/groupbyinc/flux/index/translog/Translog$Location;
ensureOpen T
! /com/groupbyinc/flux/common/bytes/BytesReference# writeTo (Ljava/io/OutputStream;)V%&
$'
) length+ ?
$, ) * . /com/groupbyinc/flux/index/seqno/SequenceNumbers0 min (JJ)J23
14 max63
17 assertNoSeqNumberConflict 5(JLcom/groupbyinc/flux/common/bytes/BytesReference;)Z9:
; F (JJI)V ?>
? data 1Lcom/groupbyinc/flux/common/bytes/BytesReference; seqNo java/lang/LongD valueOf (J)Ljava/lang/Long;FG
EH containsKey (Ljava/lang/Object;)ZJK L get &(Ljava/lang/Object;)Ljava/lang/Object;NO P (com/groupbyinc/flux/common/collect/TupleR v1 ()Ljava/lang/Object;TU
SV equalsXK
$Y >com/groupbyinc/flux/index/translog/BufferedChecksumStreamInput[ streamInput 4()Lcom/groupbyinc/flux/common/io/stream/StreamInput;]^
$_ 5(Lcom/groupbyinc/flux/common/io/stream/StreamInput;)V ?a
\b
readOperation y(Lcom/groupbyinc/flux/index/translog/BufferedChecksumStreamInput;)Lcom/groupbyinc/flux/index/translog/Translog$Operation;de
f idh w
i java/util/Objectsk '(Ljava/lang/Object;Ljava/lang/Object;)ZXm
ln typep w
q source 3()Lcom/groupbyinc/flux/common/bytes/BytesReference;st
u routingw w
x a
zC a
| version~ a
i
q
z
|
seqNo [? %] was processed twice in generation [? ], with different data. prvOp [? -(Ljava/lang/Object;)Ljava/lang/StringBuilder; k?
g?
], newOp [? v2?U
S? java/lang/Throwable? *(Ljava/lang/String;Ljava/lang/Throwable;)V ??
e? +com/groupbyinc/flux/common/bytes/BytesArray?
toBytesRef :()Lcom/groupbyinc/flux/common/apache/lucene/util/BytesRef;??
$? <(Lcom/groupbyinc/flux/common/apache/lucene/util/BytesRef;Z)V ??
?? stack capture previous op? (Ljava/lang/String;)V ??
? '(Ljava/lang/Object;Ljava/lang/Object;)V ??
S? put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;?? ? o1 3Lcom/groupbyinc/flux/index/translog/Translog$Index; o2 sameOp 4Lcom/groupbyinc/flux/index/translog/Translog$Delete; newOp 7Lcom/groupbyinc/flux/index/translog/Translog$Operation; prvOp previous rLcom/groupbyinc/flux/common/collect/Tuple; *Lcom/groupbyinc/flux/common/collect/Tuple; assertNoSeqAbove (JJ)Z entrySet ()Ljava/util/Set;?? ?
java/util/Set? stream ()Ljava/util/stream/Stream;????K lambda$assertNoSeqAbove$1 (JLjava/util/Map$Entry;)Z??
?? (Ljava/util/Map$Entry;)Z? test !(J)Ljava/util/function/Predicate;?? ? java/util/stream/Stream? filter 9(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;???? z lambda$assertNoSeqAbove$2 (JJLjava/util/Map$Entry;)V??
?? (Ljava/util/Map$Entry;)V? accept !(JJ)Ljava/util/function/Consumer;?? ? forEach (Ljava/util/function/Consumer;)V???? belowTerm
aboveSeqNo sync??????? syncUpTo (J)Z??
?
syncNeeded ()Z ? a ?? globalCheckpoint? 0 D? minTranslogGeneration? 0 D? totalOperations
getCheckpoint 1()Lcom/groupbyinc/flux/index/translog/Checkpoint; (JIJJJJJJ)V ??
D? closeIntoReader 5()Lcom/groupbyinc/flux/index/translog/TranslogReader;? T
compareAndSet (ZZ)Z
L 1com/groupbyinc/flux/index/translog/TranslogReader getLastSyncedCheckpoint
?
? ?
? ? ? ? ?(Lcom/groupbyinc/flux/index/translog/Checkpoint;Ljava/nio/channels/FileChannel;Ljava/nio/file/Path;Lcom/groupbyinc/flux/index/translog/TranslogHeader;)V ?
Ecom/groupbyinc/flux/common/apache/lucene/store/AlreadyClosedException
translog [
getGeneration a
] is already closed (path [
? newSnapshot 7()Lcom/groupbyinc/flux/index/translog/TranslogSnapshot; 4com/groupbyinc/flux/index/translog/TranslogException" 2exception while syncing before creating a snapshot$ S(Lcom/groupbyinc/flux/index/shard/ShardId;Ljava/lang/String;Ljava/lang/Throwable;)V ?&
#' !
) Ljava/io/IOException; getWrittenOffset??
- java/io/OutputStream/ flush1 T
02??
4 force6 M
_7 illegal state: 9 <= ; checkpointToSync readBytes (Ljava/nio/ByteBuffer;J)V java/nio/ByteBuffer@ remainingB ?
AC, a
E &com/groupbyinc/flux/common/io/ChannelsG #readFromFileChannelWithEofException 8(Ljava/nio/channels/FileChannel;JLjava/nio/ByteBuffer;)VIJ
HK targetBuffer Ljava/nio/ByteBuffer; translog.ckpO resolve ((Ljava/lang/String;)Ljava/nio/file/Path;QR ?S java/nio/file/OpenOptionU java/nio/file/StandardOpenOptionW WRITE "Ljava/nio/file/StandardOpenOption;YZ X[ ?(Lcom/groupbyinc/flux/index/translog/ChannelFactory;Ljava/nio/file/Path;Lcom/groupbyinc/flux/index/translog/Checkpoint;[Ljava/nio/file/OpenOption;)V ?]
D^ translogFile isCloseda?
b ] is already closedd
_N?
Lg getValueiU j ?
l | z >current should not have any operations with seq#:primaryTerm [p :r ] > t op Ljava/util/Map$Entry; getKeyxU y longValue{ a
E| global checkpoint [~ ] lower than initial gcp [? gcp
access$000 K(Lcom/groupbyinc/flux/index/translog/TranslogWriter;Ljava/lang/Exception;)V x0 x1 java/lang/Class? desiredAssertionStatus??
?? Signature Code LocalVariableTable LineNumberTable
StackMapTable
Exceptions LocalVariableTypeTable BootstrapMethods
SourceFile InnerClasses ! # $ % &