com.groupbyinc.flux.index.translog.TranslogDeletionPolicy.class Maven / Gradle / Ivy
???? 4} 9com/groupbyinc/flux/index/translog/TranslogDeletionPolicy java/lang/Object TranslogDeletionPolicy.java %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup openTranslogRef Ljava/util/Map; ?Ljava/util/Map; translogRefCounts XLjava/util/Map; minTranslogGenerationForRecovery J retentionSizeInBytes retentionAgeInMillis $assertionsDisabled Z assertNoOpenTranslogRefs ()V
java/util/Map isEmpty ()Z java/lang/AssertionError /not all translog generations have been released " (Ljava/lang/Object;)V $ %
! & values ()Ljava/util/Collection; ( ) * getClass ()Ljava/lang/Class; , -
. "java/lang/invoke/LambdaMetafactory 0 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; 2 3
1 4 5 % java/lang/Throwable 8
addSuppressed (Ljava/lang/Throwable;)V : ;
9 < = (Ljava/lang/RuntimeException;)V ? accept 9(Ljava/lang/AssertionError;)Ljava/util/function/Consumer; A B C java/util/Collection E forEach (Ljava/util/function/Consumer;)V G H F I e Ljava/lang/AssertionError; this ;Lcom/groupbyinc/flux/index/translog/TranslogDeletionPolicy; (JJ)V $
P java/util/HashMap R
S P U W Y [ com/groupbyinc/flux/Assertions ] ENABLED _ ^ ` &java/util/concurrent/ConcurrentHashMap b
c P #setMinTranslogGenerationForRecovery (J)V "java/lang/IllegalArgumentException g java/lang/StringBuilder i
j P :minTranslogGenerationForRecovery can't go backwards. new [ l append -(Ljava/lang/String;)Ljava/lang/StringBuilder; n o
j p (J)Ljava/lang/StringBuilder; n r
j s ] current [ u ] w toString ()Ljava/lang/String; y z
j { (Ljava/lang/String;)V $ }
h ~ newGen setRetentionSizeInBytes bytes setRetentionAgeInMillis ageInMillis acquireTranslogGen 0(J)Lcom/groupbyinc/flux/common/lease/Releasable; java/lang/Long ? valueOf (J)Ljava/lang/Long; ? ?
? ? &(Ljava/lang/Object;)Ljava/lang/Object; ? lambda$acquireTranslogGen$0 I(Ljava/lang/Long;)Lcom/groupbyinc/flux/common/apache/lucene/util/Counter; ? ?
? ? ? apply ()Ljava/util/function/Function; ? ? ? computeIfAbsent C(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object; ? ? ? 5com/groupbyinc/flux/common/apache/lucene/util/Counter ? addAndGet (J)J ? ?
? ? )java/util/concurrent/atomic/AtomicBoolean ?
? P ? assertAddTranslogRef (Ljava/lang/Object;)Z ? ?
?
! P lambda$acquireTranslogGen$1 /(Ljava/util/concurrent/atomic/AtomicBoolean;J)V ? ?
? ? close ?(Lcom/groupbyinc/flux/index/translog/TranslogDeletionPolicy;Ljava/util/concurrent/atomic/AtomicBoolean;J)Lcom/groupbyinc/flux/common/lease/Releasable; ? ? ? translogGen closed +Ljava/util/concurrent/atomic/AtomicBoolean; java/lang/RuntimeException ?
? P put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ? ? ? "double adding of closing reference ? *(Ljava/lang/String;Ljava/lang/Throwable;)V $ ?
! ? reference Ljava/lang/Object; existing Ljava/lang/RuntimeException; assertRemoveTranslogRef remove ? ? ? pendingTranslogRefCount ()I size ? ? ? releaseTranslogGen get ? ? ? ()J ? ?
? ? translog gen [ ? ] wasn't acquired ????????? current 7Lcom/groupbyinc/flux/common/apache/lucene/util/Counter; minTranslogGenRequired F(Ljava/util/List;Lcom/groupbyinc/flux/index/translog/TranslogWriter;)J java/io/IOException ? getMinTranslogGenRequiredByLocks ? ?
? currentTime ? ?
? getMinTranslogGenByAge H(Ljava/util/List;Lcom/groupbyinc/flux/index/translog/TranslogWriter;JJ)J ? ?
? getMinTranslogGenBySize G(Ljava/util/List;Lcom/groupbyinc/flux/index/translog/TranslogWriter;J)J ? ?
?? ??????? java/lang/Math ? max (JJ)J ? ?
? ? min ? ?
? ? minByAgeAndSize readers ELjava/util/List; Ljava/util/List; writer 3Lcom/groupbyinc/flux/index/translog/TranslogWriter;
minByLocks minByAge minBySize 1com/groupbyinc/flux/index/translog/TranslogWriter
sizeInBytes ?
getGeneration ?
java/util/List ? (I)Ljava/lang/Object; ? 1com/groupbyinc/flux/index/translog/TranslogReader
reader 3Lcom/groupbyinc/flux/index/translog/TranslogReader; i I totalSize minGen iterator ()Ljava/util/Iterator;"#$ java/util/Iterator& hasNext( ') next ()Ljava/lang/Object;+,'- getLastModifiedTime/ ?
0 maxRetentionAgeInMillis now java/lang/System4 currentTimeMillis6 ?
57 keySet ()Ljava/util/Set;9: ;
java/util/Set= stream ()Ljava/util/stream/Stream;?@>A ? 2(Ljava/lang/Long;Ljava/lang/Long;)Ljava/lang/Long;E %()Ljava/util/function/BinaryOperator; ?G H java/util/stream/StreamJ reduce 9(Ljava/util/function/BinaryOperator;)Ljava/util/Optional;LMKN java/util/OptionalP orElseR ?
QS longValueU ?
?V #getMinTranslogGenerationForRecovery getTranslogRefCount gen counter
compareAndSet (ZZ)Z\]
?^ ? f
` ? ?
b
newCounter :(Z)Lcom/groupbyinc/flux/common/apache/lucene/util/Counter;de
?f l Ljava/lang/Long; java/lang/Classk desiredAssertionStatusm
ln Signature Code LocalVariableTable LineNumberTable
StackMapTable LocalVariableTypeTable
Exceptions {(Ljava/util/List;Lcom/groupbyinc/flux/index/translog/TranslogWriter;)J |(Ljava/util/List;Lcom/groupbyinc/flux/index/translog/TranslogWriter;J)J }(Ljava/util/List;Lcom/groupbyinc/flux/index/translog/TranslogWriter;JJ)J BootstrapMethods
SourceFile InnerClasses ! p
p q 2*? ? ? (? !Y#? 'L*? ? + +Y? /W? D ? J +?? r K L 2 M N s &