热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.thrift.TException.()方法的使用及代码示例

本文整理了Java中org.apache.thrift.TException.<init>()方法的一些代码示例,展示了TException.&

本文整理了Java中org.apache.thrift.TException.()方法的一些代码示例,展示了TException.()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TException.()方法的具体详情如下:
包路径:org.apache.thrift.TException
类名称:TException
方法名:

TException.介绍

暂无

代码示例

代码示例来源:origin: apache/hive

@Override
public void writeListBegin(TList list) throws TException {
if (list.elemType == TType.STRUCT || list.elemType == TType.MAP
|| list.elemType == TType.LIST || list.elemType == TType.SET) {
throw new TException("Not implemented: nested structures");
}
firstInnerField = true;
inner = true;
}

代码示例来源:origin: apache/hive

@Override
public ByteBuffer readBinary() throws TException {
throw new TException("Not implemented for control separated data");
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public String getStormRawConf() throws TException {
try {
return FileUtils.readFileToString(new File(LoadConf.getStormYamlPath()));
} catch (IOException ex) {
throw new TException(ex);
}
}

代码示例来源:origin: apache/zeppelin

@Override
public void open(String sessionId, String className) throws TException {
logger.info(String.format("Open Interpreter %s for session %s ", className, sessionId));
Interpreter intp = getInterpreter(sessionId, className);
try {
intp.open();
} catch (InterpreterException e) {
throw new TException("Fail to open interpreter", e);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public void removeHostOutBlackList(String host) throws TException {
StormClusterState stormClusterState = data.getStormClusterState();
try {
stormClusterState.remove_from_blacklist(host);
} catch (Exception e) {
LOG.error("Failed to remove host out of black list", e);
throw new TException(e);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public void setHostInBlackList(String host) throws TException {
StormClusterState stormClusterState = data.getStormClusterState();
try {
stormClusterState.set_in_blacklist(host);
} catch (Exception e) {
LOG.error("Failed to set host in black list", e);
throw new TException(e);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public String getNimbusConf() throws TException {
try {
return JStormUtils.to_json(data.getConf());
} catch (Exception e) {
String err = "Failed to get nimbus configuration";
LOG.error(err, e);
throw new TException(err);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public void beginLibUpload(String libName) throws TException {
try {
String parent = PathUtils.parent_path(libName);
PathUtils.local_mkdirs(parent);
data.getUploaders().put(libName, Channels.newChannel(new FileOutputStream(libName)));
LOG.info("Begin upload file from client to " + libName);
} catch (Exception e) {
LOG.error("Fail to upload jar " + libName, e);
throw new TException(e);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public int updateBlobReplication(String key, int replication) throws TException {
try {
return data.getBlobStore().updateBlobReplication(key, replication);
} catch (IOException e) {
throw new TException(e);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public int getBlobReplication(String key) throws TException {
try {
return data.getBlobStore().getBlobReplication(key);
} catch (Exception e) {
throw new TException(e);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public Map registerMetrics(String topologyId, Set metrics) throws TException {
try {
return ClusterMetricsRunnable.getInstance().getContext().registerMetrics(topologyId, metrics);
} catch (Exception ex) {
LOG.error("registerMetrics error", ex);
throw new TException(ex);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public StormTopology getUserTopology(String id) throws TException {
try {
StormTopology stormtopology = StormConfig.read_nimbus_topology_code(id, data.getBlobStore());
if (stormtopology == null) {
throw new NotAliveException("No topology of " + id);
}
return stormtopology;
} catch (Exception e) {
LOG.error("Failed to get topology " + id + ",", e);
throw new TException("Failed to get system_topology");
}
}

代码示例来源:origin: apache/zeppelin

@Override
public String getFormType(String sessionId, String className) throws TException {
Interpreter intp = getInterpreter(sessionId, className);
try {
return intp.getFormType().toString();
} catch (InterpreterException e) {
throw new TException(e);
}
}

代码示例来源:origin: apache/hive

@Override
public CurrentNotificationEventId get_current_notificationEventId() throws TException {
try {
authorizeProxyPrivilege();
} catch (Exception ex) {
LOG.error("Not authorized to make the get_current_notificationEventId call. You can try to disable " +
ConfVars.EVENT_DB_NOTIFICATION_API_AUTH.toString(), ex);
throw new TException(ex);
}
RawStore ms = getMS();
return ms.getCurrentNotificationEventId();
}

代码示例来源:origin: apache/hive

@Override
public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws TException {
try {
return new TGetQueryIdResp(cliService.getQueryId(req.getOperationHandle()));
} catch (HiveSQLException e) {
throw new TException(e);
}
}

代码示例来源:origin: apache/zeppelin

@Override
public List completion(String sessionId,
String className,
String buf,
int cursor,
RemoteInterpreterContext remoteInterpreterContext)
throws TException {
Interpreter intp = getInterpreter(sessionId, className);
try {
return intp.completion(buf, cursor, convert(remoteInterpreterContext, null));
} catch (InterpreterException e) {
throw new TException("Fail to get completion", e);
}
}

代码示例来源:origin: alibaba/jstorm

@Override
public void createStateInZookeeper(String key) throws TException {
BlobStore blobStore = data.getBlobStore();
NimbusInfo nimbusInfo = data.getNimbusHostPortInfo();
if (blobStore instanceof LocalFsBlobStore) {
int versiOnForKey= BlobStoreUtils.getVersionForKey(key, nimbusInfo, data.getConf());
try {
data.getStormClusterState().setup_blobstore(key, nimbusInfo, versionForKey);
} catch (Exception e) {
throw new TException("create state in zookeeper error", e);
}
}
LOG.debug("Created state in zookeeper for key:{} for nimbus:{}", key, nimbusInfo);
}

代码示例来源:origin: alibaba/jstorm

@Override
public void deleteBlob(String key) throws TException {
BlobStore blobStore = data.getBlobStore();
blobStore.deleteBlob(key);
if (blobStore instanceof LocalFsBlobStore) {
try {
data.getStormClusterState().remove_blobstore_key(key);
data.getStormClusterState().remove_key_version(key);
} catch (Exception e) {
throw new TException(e);
}
}
LOG.info("Deleted blob for key {}", key);
}

代码示例来源:origin: apache/hive

@Test
public void testHeartbeatContinuesTException() throws Exception {
Throwable t = new TException();
doThrow(t).when(mockMetaStoreClient).heartbeat(0, LOCK_ID);
HeartbeatTimerTask task = new HeartbeatTimerTask(mockMetaStoreClient, mockListener, TRANSACTION_ID, SOURCES,
LOCK_ID);
task.run();
verifyZeroInteractions(mockListener);
}

代码示例来源:origin: apache/hbase

private ThriftHBaseServiceHandler createHandler() throws TException {
try {
Configuration cOnf= UTIL.getConfiguration();
return new ThriftHBaseServiceHandler(conf, UserProvider.instantiate(conf));
} catch (IOException ie) {
throw new TException(ie);
}
}

推荐阅读
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有