Alluxio Interpreter for Apache Zeppelin
Alluxio is a memory-centric distributed storage system enabling reliable data sharing at memory-speed across cluster frameworks.
|Alluxio master hostname
|Alluxio master port
Enabling Alluxio Interpreter
In a notebook, to enable the Alluxio interpreter, click on the Gear icon and select Alluxio.
Using the Alluxio Interpreter
In a paragraph, use
%alluxio to select the Alluxio interpreter and then input all commands.
Tip : Use ( Ctrl + . ) for autocompletion.
The Alluxio interpreter accepts the following commands.
|Print the content of the file to the console.
|chgrp "group" "path"
|Change the group of the directory or file.
|chmod "permission" "path"
|Change the permission of the directory or file.
|chown "owner" "path"
|Change the owner of the directory or file.
|copyFromLocal "source path" "remote path"
|Copy the specified file specified by "source path" to the path specified by "remote path". This command will fail if "remote path" already exists.
|copyToLocal "remote path" "local path"
|Copy the specified file from the path specified by "remote path" to a local destination.
|Display the number of folders and files matching the specified prefix in "path".
|Display the size of a file or a directory specified by the input path.
|Print the information of the blocks of a specified file.
|Free a file or all files under a directory from Alluxio. If the file/directory is also in under storage, it will still be available there.
|Get the capacity of the AlluxioFS.
|Get number of bytes used in the AlluxioFS.
|Load the data of a file or a directory from under storage into Alluxio.
|Load the metadata of a file or a directory from under storage into Alluxio.
|Display a list of hosts that have the file data.
|List all the files and directories directly under the given path with information such as size.
|mkdir "path1" ... "pathn"
|Create directory(ies) under the given paths, along with any necessary parent directories. Multiple paths separated by spaces or tabs. This command will fail if any of the given paths already exist.
|mount "path" "uri"
|Mount the underlying file system path "uri" into the Alluxio namespace as "path". The "path" is assumed not to exist and is created by the operation. No data or metadata is loaded from under storage into Alluxio. After a path is mounted, operations on objects under the mounted path are mirror to the mounted under storage.
|mv "source" "destination"
|Move a file or directory specified by "source" to a new location "destination". This command will fail if "destination" already exists.
|Persist a file or directory currently stored only in Alluxio to the underlying file system.
|Pin the given file to avoid evicting it from memory. If the given path is a directory, it recursively pins all the files contained and any new files created within this directory.
|Report to the master that a file is lost.
|Remove a file. This command will fail if the given path is a directory rather than a file.
|Set the TTL (time to live) in milliseconds to a file.
|Print the last 1KB of the specified file to the console.
|Create a 0-byte file at the specified location.
|Unmount the underlying file system path mounted in the Alluxio namespace as "path". Alluxio objects under "path" are removed from Alluxio, but they still exist in the previously mounted under storage.
|Unpin the given file to allow Alluxio to evict this file again. If the given path is a directory, it recursively unpins all files contained and any new files created within this directory.
|Remove the TTL (time to live) setting from a file.
How to test it's working
Be sure to have configured correctly the Alluxio interpreter, then open a new paragraph and type one of the above commands.
Below a simple example to show how to interact with Alluxio interpreter. Following steps are performed:
- using sh interpreter a new text file is created on local machine
- using Alluxio interpreter:
- is listed the content of the afs (Alluxio File System) root
- the file previously created is copied to afs
- is listed again the content of the afs root to check the existence of the new copied file
- is showed the content of the copied file (using the tail command)
- the file previously copied to afs is copied to local machine
- using sh interpreter it's checked the existence of the new file copied from Alluxio and its content is showed