Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveYurongSu committed Dec 13, 2024
1 parent 265113e commit f4bdc3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ protected String getClusterId() {
return ConfigNode.getInstance().getConfigManager().getClusterManager().getClusterId();
}

@Override
protected TSStatus loginIfNecessary() {
// Do nothing. Login check will be done in the data node receiver.
return StatusUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
}

@Override
protected String getReceiverFileBaseDir() {
return ConfigNodeDescriptor.getInstance().getConf().getPipeReceiverFileDir();
Expand Down Expand Up @@ -384,10 +390,4 @@ protected TSStatus loadFileV2(
}
return PipeReceiverStatusHandler.getPriorStatus(results);
}

@Override
protected TSStatus loginIfNecessary() {
// do nothing
return StatusUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,21 @@ protected String getClusterId() {
return IoTDBDescriptor.getInstance().getConfig().getClusterId();
}

@Override
protected TSStatus loginIfNecessary() {
final IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime();
if (clientSession == null || !clientSession.isLogin()) {
return SESSION_MANAGER.login(
SESSION_MANAGER.getCurrSession(),
username,
password,
ZoneId.systemDefault().toString(),
SessionManager.CURRENT_RPC_VERSION,
IoTDBConstant.ClientVersion.V_1_0);
}
return StatusUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
}

@Override
protected String getReceiverFileBaseDir() throws DiskSpaceInsufficientException {
// Get next receiver file base dir by folder manager
Expand Down Expand Up @@ -897,19 +912,4 @@ public synchronized void handleExit() {

super.handleExit();
}

@Override
protected TSStatus loginIfNecessary() {
IClientSession clientSession = SESSION_MANAGER.getCurrSessionAndUpdateIdleTime();
if (clientSession == null || !clientSession.isLogin()) {
return SESSION_MANAGER.login(
SESSION_MANAGER.getCurrSession(),
username,
password,
ZoneId.systemDefault().toString(),
SessionManager.CURRENT_RPC_VERSION,
IoTDBConstant.ClientVersion.V_1_0);
}
return StatusUtils.getStatus(TSStatusCode.SUCCESS_STATUS);
}
}

0 comments on commit f4bdc3b

Please sign in to comment.