All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.groupbyinc.flux.common.util.MultiDataPathUpgrader.class Maven / Gradle / Ivy

There is a newer version: 59
Show newest version
????3?5com/groupbyinc/flux/common/util/MultiDataPathUpgraderjava/lang/ObjectMultiDataPathUpgrader.javaCcom/groupbyinc/flux/common/util/MultiDataPathUpgrader$ShardFileInfo
ShardFileInfo7com/groupbyinc/flux/common/util/MultiDataPathUpgrader$1	@com/groupbyinc/flux/common/apache/lucene/index/CheckIndex$Status9com/groupbyinc/flux/common/apache/lucene/index/CheckIndex
Status0com/groupbyinc/flux/env/NodeEnvironment$NodePath'com/groupbyinc/flux/env/NodeEnvironmentNodePathnodeEnvironment)Lcom/groupbyinc/flux/env/NodeEnvironment;logger-Lcom/groupbyinc/flux/common/logging/ESLogger;$assertionsDisabledZ,(Lcom/groupbyinc/flux/env/NodeEnvironment;)V()V
getClass()Ljava/lang/Class; !
"*com/groupbyinc/flux/common/logging/Loggers$	getLogger@(Ljava/lang/Class;)Lcom/groupbyinc/flux/common/logging/ESLogger;&'
%(	*	,this7Lcom/groupbyinc/flux/common/util/MultiDataPathUpgrader;upgradeW(Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/index/shard/ShardPath;)Vjava/io/IOException2java/lang/Throwable4Hcom/groupbyinc/flux/common/apache/lucene/store/LockObtainFailedException6availableShardPaths@(Lcom/groupbyinc/flux/index/shard/ShardId;)[Ljava/nio/file/Path;89
:isTargetPathConfiguredC([Ljava/nio/file/Path;Lcom/groupbyinc/flux/index/shard/ShardPath;)Z<=
>"java/lang/IllegalArgumentException@/shard path must be one of the shards data pathsB(Ljava/lang/String;)VD
AE[Ljava/nio/file/Path;G	IneedsUpgrading,(Lcom/groupbyinc/flux/index/shard/ShardId;)ZKL
Mjava/lang/AssertionErrorO1Should not upgrade a path that needs no upgradingQ(Ljava/lang/Object;)VS
PT!{} upgrading multi data dir to {}V)com/groupbyinc/flux/index/shard/ShardPathXgetDataPath()Ljava/nio/file/Path;Z[
Y\+com/groupbyinc/flux/common/logging/ESLogger^info((Ljava/lang/String;[Ljava/lang/Object;)V`a_b2com/groupbyinc/flux/index/shard/ShardStateMetaDatadFORMAT1Lcom/groupbyinc/flux/gateway/MetaDataStateFormat;fg	eh/com/groupbyinc/flux/gateway/MetaDataStateFormatjloadLatestStateV(Lcom/groupbyinc/flux/common/logging/ESLogger;[Ljava/nio/file/Path;)Ljava/lang/Object;lm
knjava/lang/IllegalStateExceptionpjava/lang/StringBuilderr
sappend-(Ljava/lang/Object;)Ljava/lang/StringBuilder;uv
sw! no shard state found in any of: y-(Ljava/lang/String;)Ljava/lang/StringBuilder;u{
s|java/util/Arrays~toString'([Ljava/lang/Object;)Ljava/lang/String;??
?) please check and remove them if possible?()Ljava/lang/String;??
s?
qE{} loaded shard state {}?versionJ??	e?java/nio/file/Path?getShardStatePath?[
Y?write+(Ljava/lang/Object;J[Ljava/nio/file/Path;)V??
k?resolveIndex?[
Y?%java/nio/file/attribute/FileAttribute?java/nio/file/Files?createDirectoriesR(Ljava/nio/file/Path;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;??
??@com/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectory?(Ljava/nio/file/Path;)V?
??
write.lock?
obtainLockI(Ljava/lang/String;)Lcom/groupbyinc/flux/common/apache/lucene/store/Lock;??
??index?upgradeFiles?(Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/index/shard/ShardPath;Ljava/nio/file/Path;Ljava/lang/String;[Ljava/nio/file/Path;)V??
?3com/groupbyinc/flux/common/apache/lucene/store/Lock?close?
??'com/groupbyinc/flux/index/shard/ShardId?
addSuppressed(Ljava/lang/Throwable;)V??
5?Can't obtain lock on ?*(Ljava/lang/String;Ljava/lang/Throwable;)V?
q?
??resolveTranslog?[
Y?translog?{} wipe upgraded directories?equals(Ljava/lang/Object;)Z????{} wipe shard directories: [{}]?5com/groupbyinc/flux/common/apache/lucene/util/IOUtils?rm([Ljava/nio/file/Path;)V??
??-com/groupbyinc/flux/common/io/FileSystemUtils?files+(Ljava/nio/file/Path;)[Ljava/nio/file/Path;??
??index folder [?
] is empty?translog folder [?lock5Lcom/groupbyinc/flux/common/apache/lucene/store/Lock;exJLcom/groupbyinc/flux/common/apache/lucene/store/LockObtainFailedException;	directoryBLcom/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectory;pathLjava/nio/file/Path;shard)Lcom/groupbyinc/flux/index/shard/ShardId;
targetPath+Lcom/groupbyinc/flux/index/shard/ShardPath;pathsloaded4Lcom/groupbyinc/flux/index/shard/ShardStateMetaData;
checkIndex.(Lcom/groupbyinc/flux/index/shard/ShardPath;)V6com/groupbyinc/flux/common/io/stream/BytesStreamOutput?
?java/io/PrintStream?6com/groupbyinc/flux/common/google/common/base/Charsets?UTF_8Ljava/nio/charset/Charset;??	??java/nio/charset/Charsetname?
,(Ljava/io/OutputStream;ZLjava/lang/String;)V
?=(Lcom/groupbyinc/flux/common/apache/lucene/store/Directory;)V	


setInfoStream(Ljava/io/PrintStream;)V
D()Lcom/groupbyinc/flux/common/apache/lucene/index/CheckIndex$Status;?
flush
?clean	check index [failure]
{}java/lang/Stringbytes3()Lcom/groupbyinc/flux/common/bytes/BytesReference;
?/com/groupbyinc/flux/common/bytes/BytesReference!toBytes()[B#$"%([BLjava/nio/charset/Charset;)V'
(warn*a_+index check failure-8com/groupbyinc/flux/common/apache/lucene/store/Directory/
?
0?statusBLcom/groupbyinc/flux/common/apache/lucene/index/CheckIndex$Status;;Lcom/groupbyinc/flux/common/apache/lucene/index/CheckIndex;:Lcom/groupbyinc/flux/common/apache/lucene/store/Directory;os8Lcom/groupbyinc/flux/common/io/stream/BytesStreamOutput;outLjava/io/PrintStream;_state;resolve((Ljava/lang/String;)Ljava/nio/file/Path;=>??java/nio/file/LinkOptionAexists2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)ZCD
?E
numPathsExistI
pickShardPathV(Lcom/groupbyinc/flux/index/shard/ShardId;)Lcom/groupbyinc/flux/index/shard/ShardPath;Shard doesn't need upgradingK	nodePaths5()[Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath;MN
O3[Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath;Q?(Lcom/groupbyinc/flux/index/shard/ShardId;)Ljava/nio/file/Path;=S
TgetShardFileInfo?(Lcom/groupbyinc/flux/index/shard/ShardId;[Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath;)[Lcom/groupbyinc/flux/common/util/MultiDataPathUpgrader$ShardFileInfo;VW
X????????
PF[Lcom/groupbyinc/flux/common/util/MultiDataPathUpgrader$ShardFileInfo;_spaceUsedBySharda?	busableSpaced?	ejava/lang/Mathgmin(JJ)Jij
hkmaxmj
hn$Can't upgrade path available space: p-com/groupbyinc/flux/common/unit/ByteSizeValuer(J)Vt
su required space: w??	{_na_}g(ZLjava/nio/file/Path;Ljava/nio/file/Path;Ljava/lang/String;Lcom/groupbyinc/flux/index/shard/ShardId;)V
Y?2Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath;ELcom/groupbyinc/flux/common/util/MultiDataPathUpgrader$ShardFileInfo;
shardFileInfototalBytesUsedByShardleastUsableSpacemostUsableSpacetargetgetUsabelSpace5(Lcom/groupbyinc/flux/env/NodeEnvironment$NodePath;)J??
?getSpaceUsedByShard(Ljava/nio/file/Path;)J??
?(Ljava/nio/file/Path;JJ)V?
?usabelSpacei<(Lcom/groupbyinc/flux/common/util/MultiDataPathUpgrader;[J)V?

?walkFileTreeE(Ljava/nio/file/Path;Ljava/nio/file/FileVisitor;)Ljava/nio/file/Path;??
??[J?	fileStoreLjava/nio/file/FileStore;??	?java/nio/file/FileStore?getUsableSpace()J??
??java/util/ArrayList?
?java/util/List?#{} upgrading [{}] from [{}] to [{}]?newDirectoryStream5(Ljava/nio/file/Path;)Ljava/nio/file/DirectoryStream;??
??java/nio/file/DirectoryStream?iterator()Ljava/util/Iterator;????java/util/Iterator?hasNext()Z????next()Ljava/lang/Object;????getFileName?[????
?isDirectory?D
??{} move file [{}] size: [{}]?size??
??java/lang/Long?valueOf(J)Ljava/lang/Long;??
??*(Ljava/nio/file/Path;)Ljava/nio/file/Path;=???upgrade_?_?createTempFilev(Ljava/nio/file/Path;Ljava/lang/String;Ljava/lang/String;[Ljava/nio/file/attribute/FileAttribute;)Ljava/nio/file/Path;??
??java/nio/file/CopyOption? java/nio/file/StandardCopyOption?COPY_ATTRIBUTES"Ljava/nio/file/StandardCopyOption;??	??REPLACE_EXISTING??	??copyY(Ljava/nio/file/Path;Ljava/nio/file/Path;[Ljava/nio/file/CopyOption;)Ljava/nio/file/Path;??
??ATOMIC_MOVE??	??move??
??delete??
??add??????isEmpty????{} fsync files??{} syncing [{}]fsync(Ljava/nio/file/Path;Z)V
?{} syncing directory [{}]

targetFiletargetTempFilefilestream5Ljava/nio/file/DirectoryStream;Ljava/nio/file/DirectoryStream;	sourceDirmoved	targetDir
folderNameLjava/lang/String;
movedFiles&Ljava/util/List;Ljava/util/List;upgradeMultiDataPathY(Lcom/groupbyinc/flux/env/NodeEnvironment;Lcom/groupbyinc/flux/common/logging/ESLogger;)V
nodeDataPaths()[Ljava/nio/file/Path;

 findAllIndices()Ljava/util/Set;"#
$
java/util/Set&'?com/groupbyinc/flux/index/Index)
*E
indexPaths8(Lcom/groupbyinc/flux/index/Index;)[Ljava/nio/file/Path;,-
.findAllShardIds&([Ljava/nio/file/Path;)Ljava/util/Set;01
2	shardLockO(Lcom/groupbyinc/flux/index/shard/ShardId;J)Lcom/groupbyinc/flux/env/ShardLock;45
6IJ
801
:??
<!com/groupbyinc/flux/env/ShardLock>'{} no upgrade needed - already upgraded@debugBa_C
??	shardPath#Lcom/groupbyinc/flux/env/ShardLock;shardIdupgrader
allIndices#Ljava/util/Set;Ljava/util/Set;nodeEnv5com/groupbyinc/flux/common/google/common/collect/SetsN
newHashSet()Ljava/util/HashSet;PQ
ORfindAllShardsForIndex%(Ljava/nio/file/Path;)Ljava/util/Set;TU
VaddAll(Ljava/util/Collection;)ZXY'Zlocation	locationsshardIds:Ljava/util/Set;java/util/HashSet`
a8com/groupbyinc/flux/common/google/common/primitives/IntsctryParse'(Ljava/lang/String;)Ljava/lang/Integer;ef
dgjava/lang/IntegeriintValue()Ikl
jm(Ljava/lang/String;I)Vo
?p'?idLjava/lang/Integer;currentIndex	indexPathjava/lang/ClassxdesiredAssertionStatusz?
y{CodeLocalVariableTableLineNumberTable
StackMapTable
ExceptionsLocalVariableTypeTable	SignatureQ([Ljava/nio/file/Path;)Ljava/util/Set;P(Ljava/nio/file/Path;)Ljava/util/Set;
SourceFileInnerClasses!}U*?**?#?)?+*+?-?~./>6?@01}??*?-+?;N*-,???
?AYC?F??J?*+?N?
?PYR?U?*?+W?Y+SY,?]S?c?i*?+-?o?e:?*?qY?sY?t+?xz?}-???}??}?????*?+??Y+SYS?c?i????Y,??S??,??????W??Y,????::???::*+,,???-???U????H:		???<???4:		:	?:
?!????:?????
??%:?qY?sY?t??},???x???Ŀ?U??ŧH:???<?ŧ4::?:?!??ŧ:

??????*+,,???-??*?+??Y+S?c-:?66?B2:,?????'*?+??Y+SYS?c??YS?؄???,???޾?&?qY?sY?t?},???x?}?????,?ȸ޾?&?qY?sY?t?},?ȶx?}????????5??5??*/25 ?FI7uz}5?k?5?k????5???~\	?g??K ???????2???./??????	??G^2???#I	JKM4NNO^PcQ?S?U?V?W?X?Y?ZXZF\IZK[k^?W?^?a?c?d?e	f!g-d3k>laolp?r???H?Ue?v	?YHe?5?55G5H5??YHe?5?555??YHe?5B7!Q5G5H5?
?YHe?555??YHe?*H??--?3??}?	
/??Y??M??Y,???N??Y+????::?Y?::-??:-???4*?+?Y?Y,? ?&??)S?,?qY.????U??1?H:???<?1?4::?:	?!??1?:

????1	??U??2?H:???<?2?4::?:?!??2?:????2??
???56??56?????5??????5(??5(?5?~HC=343??5%	?6/.//??'789:Fxyz({3z6|<}C~GO?u????z???z?.?????Y??055Q5G5H5?
Y??05555?Y??05Q5G5H5?Y??0555?Y???3KL}?P*?-+?;M,??B>,:?66?.2:?A?F?H?N??)??HH+??HIJ}
?*+?N??qYL???*?-?PM,N-?66?-2:+?U????W????*+,?YN	7Z7	\7?J?-?*?-+?;???PY?^?-:

?66?>
2:?ca7	?f?ca?l7	?f?ca?o7??????9?qY?sY?tq?}?sY?v?xx?}?sY?v?x?????-2:
	yi??7-:?66?"2:?c
?c??:
???ݧ4-:?66?"2:?f
?f??:
???ݻYY
?|
?|~+???~z1???.`?*`?^`??./???r?QLA?_O>??T9??	Y4?????
v????1???E?L?O?T?Y?u????????????????*?8?<?E?^?l?p?v??r??RR? ?/
?R`?
`?A=??R``??
`??3VW}?	A,??N6-??2,2+?U:*,2??7-?Y*????S????-?~H??$??	6?HA./A??A?Q;`_????$?9?????	`?5?3??}}%?Y	PM+?B?F?+?
Y*,????W,/?~ %./%??a????!???!??3??}L
+??M,???~ 
./
????
???3??}?F??Y??::?66		??	2:

,?]????
?@:?B?F?y*?+??Y+SYSYSY-S?c??::
-????W??:????????:??????Ț???B?˙???*?+??Y+SY??SY?и?S?c-????:-ۻsY?tݶ}?????}??????:??Y??SY??S??W??Y??S??W????W??*?]
????N:
???B???8::
?:?%
????:
???
????	??T??z*?+?Y+S?c?:???6????:*?+?Y+SY??S?c?	???*?+?Y+SY-S?c-?	?ips5t_?5t_????5???~??e?#9
????qM<??#???
$?F./F??F??F?FF?G	=?qM	=? 		#
1<H
jt}?????#;MR\_???	?"?$?%&'%(()@*E,???
?Y?H?H?p?Y?H?H???5??8???S5I5H5??Y?H?H???555?
?Y?H?H??&??<?3<=}?.+N-?66?-2:,?]?????????~*??../.?G.??34$5&3,8??	H?	}?
*????Y*?!M*?%N-?(:???????:*?*Y?+?/?3?(:????????:*	?7::	,?N?+,?9:
,
?;
???B?F?	,
?=?+A?YS?D?U	??E?H:
	
???<?E?4:

:	
?:?!	??E?:	????E???D??????5n??5n?????5???~RF?
k??Gb?H?5???I/?JLM??JKN@	ABD5EbFnGwHI?M?N?P?Q?S?F?STUW???'??,??O??5Q5G5H5?_'????555?_'?????3?01}?8?SL*M,?>6?',2:?B?˙+?W?[W????+?~ \?8]G4^L?4^_Z[\$]0[6`??H'H#??3??
TU}ٻaY?bL*?B?˙?*??MN*????:,??:???M????:?B?˙2?????h:???Y?n?q:+?rW???,?S-?,???F:-???;,???2:N?:	,?!-?,???:
-
???	,??	?+????5??5?????5???~Hw	s?bHtE;F?'\u??v??^L???^_>defg'hEiQjbkglwm?p?q?f?q?s?[?/?'?5??P?P5
H5G5?
?'?555
??'?3??w}4?|???J?3?@??"
		




© 2015 - 2025 Weber Informatics LLC | Privacy Policy