Skip to content

Commit

Permalink
Merge pull request #1638 from chen-tian/tachyon-1047
Browse files Browse the repository at this point in the history
[TACHYON-1047] Rename setTachyonStoreType to setTachyonStorageType
  • Loading branch information
apc999 committed Sep 23, 2015
2 parents 9e53b51 + 9111345 commit 4207b78
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Builder setStorageTypes(TachyonStorageType tachyonStorageType, UnderStora
* @param tachyonStorageType the Tachyon storage type to use
* @return the builder
*/
public Builder setTachyonStoreType(TachyonStorageType tachyonStorageType) {
public Builder setTachyonStorageType(TachyonStorageType tachyonStorageType) {
mTachyonStorageType = tachyonStorageType;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static TachyonFile createByteFile(TachyonFileSystem tfs, TachyonURI fileU
try {
ClientOptions options =
new ClientOptions.Builder(ClientContext.getConf())
.setTachyonStoreType(tachyonStorageType).setUnderStorageType(underStorageType)
.setTachyonStorageType(tachyonStorageType).setUnderStorageType(underStorageType)
.build();
FileOutStream os = tfs.getOutStream(fileURI, options);

Expand Down Expand Up @@ -112,7 +112,7 @@ public static TachyonFile createByteFile(TachyonFileSystem tfs, String fileName,
try {
ClientOptions options =
new ClientOptions.Builder(ClientContext.getConf())
.setTachyonStoreType(tachyonStorageType).setUnderStorageType(underStorageType)
.setTachyonStorageType(tachyonStorageType).setUnderStorageType(underStorageType)
.setBlockSize(blockCapacityByte).build();
FileOutStream os = tfs.getOutStream(new TachyonURI(fileName), options);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ public FileInStream getInStream(ReadType readType) throws IOException {
ClientOptions.Builder optionsBuilder = new ClientOptions.Builder(mTachyonConf);
optionsBuilder.setBlockSize(info.getBlockSizeBytes());
if (readType.isCache()) {
optionsBuilder.setTachyonStoreType(TachyonStorageType.STORE);
optionsBuilder.setTachyonStorageType(TachyonStorageType.STORE);
} else {
optionsBuilder.setTachyonStoreType(TachyonStorageType.NO_STORE);
optionsBuilder.setTachyonStorageType(TachyonStorageType.NO_STORE);
}
try {
return mTFS.getInStream(mTFS.open(uri), optionsBuilder.build());
Expand Down Expand Up @@ -263,9 +263,9 @@ public FileOutStream getOutStream(WriteType writeType) throws IOException {
optionsBuilder.setBlockSize(info.getBlockSizeBytes());

if (writeType.isCache()) {
optionsBuilder.setTachyonStoreType(TachyonStorageType.STORE);
optionsBuilder.setTachyonStorageType(TachyonStorageType.STORE);
} else {
optionsBuilder.setTachyonStoreType(TachyonStorageType.NO_STORE);
optionsBuilder.setTachyonStorageType(TachyonStorageType.NO_STORE);
}
if (writeType.isThrough()) {
optionsBuilder.setUnderStorageType(UnderStorageType.PERSIST);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public static final void beforeClass() throws Exception {
sTfs = sLocalTachyonCluster.getClient();
sTachyonConf = sLocalTachyonCluster.getMasterTachyonConf();
sWriteBoth =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.PERSIST).build();
sWriteTachyon =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.NO_PERSIST).build();
sWriteUnderStore =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.setUnderStorageType(UnderStorageType.PERSIST).build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public static final void beforeClass() throws Exception {
sTfs = sLocalTachyonCluster.getClient();
sTachyonConf = sLocalTachyonCluster.getMasterTachyonConf();
sWriteBoth =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.PERSIST).build();
sWriteTachyon =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.NO_PERSIST).build();
sWriteUnderStore =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.setUnderStorageType(UnderStorageType.PERSIST).build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ public static final void beforeClass() throws Exception {
sTfs = sLocalTachyonCluster.getClient();
sTachyonConf = sLocalTachyonCluster.getMasterTachyonConf();
sWriteBoth =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.PERSIST).build();
sWriteTachyon =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.NO_PERSIST).build();
sReadCache =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.build();
sReadNoCache =
new ClientOptions.Builder(sTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(sTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ public final void before() throws Exception {
mTachyonConf = mLocalTachyonCluster.getMasterTachyonConf();
mTfs = mLocalTachyonCluster.getClient();
mWriteTachyon =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(mTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.NO_PERSIST).build();
mWriteUnderStore =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(mTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.setUnderStorageType(UnderStorageType.PERSIST).build();
mReadCache =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(mTachyonConf).setTachyonStorageType(TachyonStorageType.STORE)
.build();
mReadNoCache =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(mTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public static void beforeClass() throws Exception {
new ClientOptions.Builder(sLocalTachyonCluster.getMasterTachyonConf())
.setStorageTypes(TachyonStorageType.STORE, UnderStorageType.PERSIST).build();
sReadCache =
new ClientOptions.Builder(sLocalTachyonCluster.getMasterTachyonConf()).setTachyonStoreType(
TachyonStorageType.STORE).build();
new ClientOptions.Builder(sLocalTachyonCluster.getMasterTachyonConf())
.setTachyonStorageType(TachyonStorageType.STORE).build();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void newFilesInheritPinness() throws Exception {

private TachyonFile createEmptyFile(TachyonURI fileURI) throws IOException, TException {
ClientOptions options =
new ClientOptions.Builder(new TachyonConf()).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(new TachyonConf()).setTachyonStorageType(TachyonStorageType.STORE)
.setUnderStorageType(UnderStorageType.NO_PERSIST).build();
FileOutStream os = mTfs.getOutStream(fileURI, options);
os.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void lockBlockTest() throws Exception {
final int blockSize = (int) WORKER_CAPACITY_BYTES / 2;

ClientOptions options = new ClientOptions.Builder(new TachyonConf()).setBlockSize(blockSize)
.setTachyonStoreType(TachyonStorageType.STORE).build();
.setTachyonStorageType(TachyonStorageType.STORE).build();
FileOutStream out = mTfs.getOutStream(new TachyonURI("/testFile"), options);
TachyonFile file = mTfs.open(new TachyonURI("/testFile"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private TachyonFile createAndWriteFile(TachyonURI filePath,
}

ClientOptions options =
new ClientOptions.Builder(new TachyonConf()).setTachyonStoreType(tachyonStorageType)
new ClientOptions.Builder(new TachyonConf()).setTachyonStorageType(tachyonStorageType)
.setUnderStorageType(underStorageType).build();
FileOutStream os = mTFS.getOutStream(filePath, options);
os.write(buf.array());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void deleteWhileReadTest() throws Exception {
Assert.assertTrue(mTFS.getInfo(file).getInMemoryPercentage() == 100);
// Open the file
ClientOptions options =
new ClientOptions.Builder(new TachyonConf()).setTachyonStoreType(TachyonStorageType.STORE)
new ClientOptions.Builder(new TachyonConf()).setTachyonStorageType(TachyonStorageType.STORE)
.build();
FileInStream in = mTFS.getInStream(file, options);
Assert.assertEquals(0, in.read());
Expand Down Expand Up @@ -218,7 +218,7 @@ public void promoteBlock() throws Exception {
}

FileInStream is = mTFS.getInStream(toPromote, new ClientOptions.Builder(mWorkerConf)
.setTachyonStoreType(TachyonStorageType.PROMOTE).build());
.setTachyonStorageType(TachyonStorageType.PROMOTE).build());
byte[] buf = new byte[toPromoteLen];
int len = is.read(buf);
is.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void displayFile(TachyonURI path, HttpServletRequest request, long offse
FileInfo fileInfo = tFS.getInfo(tFile);
if (fileInfo.isComplete) {
ClientOptions readNoCache = new ClientOptions.Builder(mTachyonConf)
.setTachyonStoreType(TachyonStorageType.NO_STORE).build();
.setTachyonStorageType(TachyonStorageType.NO_STORE).build();
FileInStream is = tFS.getInStream(tFile, readNoCache);
try {
int len = (int) Math.min(5 * Constants.KB, fileInfo.length - offset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void downloadFile(TachyonURI path, HttpServletRequest request,
try {
// TODO(jiri): Should we use MasterContext here instead?
ClientOptions op = new ClientOptions.Builder(
new TachyonConf()).setTachyonStoreType(TachyonStorageType.NO_STORE).build();
new TachyonConf()).setTachyonStorageType(TachyonStorageType.NO_STORE).build();
is = tachyonClient.getInStream(fd, op);
out = response.getOutputStream();
ByteStreams.copy(is, out);
Expand Down
10 changes: 5 additions & 5 deletions shell/src/main/java/tachyon/shell/TFsShell.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public int cat(TachyonURI path) throws IOException {

if (!tFile.isFolder) {
ClientOptions op =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(mTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.build();
FileInStream is;
try {
Expand Down Expand Up @@ -178,8 +178,8 @@ private int loadPath(TachyonFileSystem tachyonClient, TachyonURI filePath) throw
Closer closer = Closer.create();
try {
ClientOptions op =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.STORE)
.build();
new ClientOptions.Builder(mTachyonConf)
.setTachyonStorageType(TachyonStorageType.STORE) .build();
FileInStream in = closer.register(mTfs.getInStream(fd, op));
byte[] buf = new byte[8 * Constants.MB];
while (in.read(buf) != -1) {
Expand Down Expand Up @@ -417,7 +417,7 @@ public int copyFileToLocal(TachyonURI srcPath, File dstFile) throws IOException
Closer closer = Closer.create();
try {
ClientOptions op =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(mTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.build();
FileInStream is = closer.register(mTfs.getInStream(srcFd, op));
FileOutputStream out = closer.register(new FileOutputStream(dstFile));
Expand Down Expand Up @@ -1043,7 +1043,7 @@ public int tail(TachyonURI path) throws IOException {

if (!fInfo.isFolder) {
ClientOptions op =
new ClientOptions.Builder(mTachyonConf).setTachyonStoreType(TachyonStorageType.NO_STORE)
new ClientOptions.Builder(mTachyonConf).setTachyonStorageType(TachyonStorageType.NO_STORE)
.build();
FileInStream is = null;
try {
Expand Down
4 changes: 2 additions & 2 deletions shell/src/test/java/tachyon/shell/TFsShellTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void copyFromLocalLargeTest() throws IOException, TException {
Assert.assertEquals(SIZE_BYTES, fileInfo.length);

ClientOptions options =
new ClientOptions.Builder(new TachyonConf()).setTachyonStoreType(
new ClientOptions.Builder(new TachyonConf()).setTachyonStorageType(
TachyonStorageType.NO_STORE).build();
FileInStream tfis = mTfs.getInStream(tFile, options);
byte[] read = new byte[SIZE_BYTES];
Expand Down Expand Up @@ -490,7 +490,7 @@ public void mkdirTest() throws IOException, TException {

private byte[] readContent(TachyonFile tFile, int length) throws IOException, TException {
ClientOptions options =
new ClientOptions.Builder(new TachyonConf()).setTachyonStoreType(
new ClientOptions.Builder(new TachyonConf()).setTachyonStorageType(
TachyonStorageType.NO_STORE).build();
FileInStream tfis = mTfs.getInStream(tFile, options);
byte[] read = new byte[length];
Expand Down

0 comments on commit 4207b78

Please sign in to comment.