如何在 Tachyon 中设置文件的 TTL

How to set TTL of file in Tachyon

我看到在 Tachyon configuration 中有一个键 tachyon.master.ttlchecker.interval.ms ("Time interval (in milliseconds) to periodically delete the files with expired ttl value.") 但我找遍了,找不到设置 Tachyon 文件的 TTL 值的方法.

如何设置 Tachyon 文件的 TTL(最好从 java/scala 程序)?

正如我在 docs 中看到的:

"Each site deployment and application client can also override the default property values via tachyon-site.properties file. Note that, this file must be in the classpath of the Java VM in which Tachyon is running. The easiest way is to put the site properties file in directory $TACHYON_HOME/conf."

因此,尝试将 TTL 值放入该文件即可。如果不存在,请尝试添加它。

您也可以在tachyon-env.sh中设置环境变量。

# Worker size set to 512 MB 
# Set worker folder to /Volumes/ramdist/tachyonworker
# Set TTL to your value

export TACHYON_JAVA_OPTS="
  -Dtachyon.worker.memory.size=512MB 
  -Dtachyon.worker.data.folder=/Volumes/ramdisk/tachyonworker/
  -Dtachyon.master.ttlchecker.interval.ms=<YOUR TTL VALUE>
"

在 0.8 中,TachyonFileSystem 上有一个 API 用于创建文件 https://github.com/amplab/tachyon/blob/v0.8.2/clients/unshaded/src/main/java/tachyon/client/file/TachyonFileSystemCore.java#L59

CreateOptions有TTL字段。 https://github.com/amplab/tachyon/blob/v0.8.2/clients/unshaded/src/main/java/tachyon/client/file/options/CreateOptions.java#L74