Skip to content

Commit

Permalink
BW for lineage master Thrift services API.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimsa committed May 16, 2017
1 parent 0995507 commit d5e178a
Show file tree
Hide file tree
Showing 14 changed files with 4,456 additions and 350 deletions.
Expand Up @@ -15,7 +15,12 @@
import alluxio.Constants; import alluxio.Constants;
import alluxio.job.CommandLineJob; import alluxio.job.CommandLineJob;
import alluxio.thrift.AlluxioService; import alluxio.thrift.AlluxioService;
import alluxio.thrift.CreateLineageTOptions;
import alluxio.thrift.DeleteLineageTOptions;
import alluxio.thrift.GetLineageInfoListTOptions;
import alluxio.thrift.LineageMasterClientService; import alluxio.thrift.LineageMasterClientService;
import alluxio.thrift.ReinitializeFileTOptions;
import alluxio.thrift.ReportLostFileTOptions;
import alluxio.wire.LineageInfo; import alluxio.wire.LineageInfo;
import alluxio.wire.ThriftUtils; import alluxio.wire.ThriftUtils;
import alluxio.wire.TtlAction; import alluxio.wire.TtlAction;
Expand Down Expand Up @@ -82,7 +87,8 @@ public synchronized long createLineage(final List<String> inputFiles,
@Override @Override
public Long call() throws TException { public Long call() throws TException {
return mClient.createLineage(inputFiles, outputFiles, return mClient.createLineage(inputFiles, outputFiles,
ThriftUtils.toThrift(job.generateCommandLineJobInfo())); ThriftUtils.toThrift(job.generateCommandLineJobInfo()), new CreateLineageTOptions())
.getId();
} }
}); });
} }
Expand All @@ -99,7 +105,7 @@ public synchronized boolean deleteLineage(final long lineageId, final boolean ca
return retryRPC(new RpcCallable<Boolean>() { return retryRPC(new RpcCallable<Boolean>() {
@Override @Override
public Boolean call() throws TException { public Boolean call() throws TException {
return mClient.deleteLineage(lineageId, cascade); return mClient.deleteLineage(lineageId, cascade, new DeleteLineageTOptions()).isSuccess();
} }
}); });
} }
Expand All @@ -118,8 +124,8 @@ public synchronized long reinitializeFile(final String path, final long blockSiz
return retryRPC(new RpcCallable<Long>() { return retryRPC(new RpcCallable<Long>() {
@Override @Override
public Long call() throws TException { public Long call() throws TException {
return mClient.reinitializeFile(path, blockSizeBytes, ttl, return mClient.reinitializeFile(path, blockSizeBytes, ttl, ThriftUtils.toThrift(ttlAction),
ThriftUtils.toThrift(ttlAction)); new ReinitializeFileTOptions()).getId();
} }
}); });
} }
Expand All @@ -134,7 +140,8 @@ public synchronized List<LineageInfo> getLineageInfoList() throws IOException {
@Override @Override
public List<LineageInfo> call() throws TException { public List<LineageInfo> call() throws TException {
List<LineageInfo> result = new ArrayList<>(); List<LineageInfo> result = new ArrayList<>();
for (alluxio.thrift.LineageInfo lineageInfo : mClient.getLineageInfoList()) { for (alluxio.thrift.LineageInfo lineageInfo : mClient
.getLineageInfoList(new GetLineageInfoListTOptions()).getLineageInfoList()) {
result.add(ThriftUtils.fromThrift(lineageInfo)); result.add(ThriftUtils.fromThrift(lineageInfo));
} }
return result; return result;
Expand All @@ -151,7 +158,7 @@ public synchronized void reportLostFile(final String path) throws IOException {
retryRPC(new RpcCallable<Void>() { retryRPC(new RpcCallable<Void>() {
@Override @Override
public Void call() throws TException { public Void call() throws TException {
mClient.reportLostFile(path); mClient.reportLostFile(path, new ReportLostFileTOptions());
return null; return null;
} }
}); });
Expand Down
285 changes: 285 additions & 0 deletions core/common/src/main/java/alluxio/thrift/CreateLineageTOptions.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5e178a

Please sign in to comment.