Skip to content

Commit

Permalink
remove redundant ExecuteThreadStatus and related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hgryoo committed Mar 7, 2023
1 parent bd2bfa3 commit c03d08a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 81 deletions.
29 changes: 0 additions & 29 deletions src/jsp/com/cubrid/jsp/ExecuteThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import java.nio.ByteBuffer;
import java.sql.SQLException;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

public class ExecuteThread extends Thread {

Expand Down Expand Up @@ -92,8 +91,6 @@ public class ExecuteThread extends Thread {
private CUBRIDUnpacker unpacker = new CUBRIDUnpacker();
private CUBRIDPacker packer;

private AtomicInteger status = new AtomicInteger(ExecuteThreadStatus.IDLE.getValue());

private StoredProcedure storedProcedure = null;
private PrepareArgs prepareArgs = null;

Expand Down Expand Up @@ -129,22 +126,6 @@ public void closeSocket() {
// charSet = null;
}

public void setStatus(Integer value) {
this.status.set(value);
}

public void setStatus(ExecuteThreadStatus value) {
this.status.set(value.getValue());
}

public Integer getStatus() {
return status.get();
}

public boolean compareStatus(ExecuteThreadStatus value) {
return (status.get() == value.getValue());
}

public void setCharSet(String conCharsetName) {
// this.charSet = conCharsetName;
}
Expand Down Expand Up @@ -228,7 +209,6 @@ public void run() {
ContextManager.deregisterThread(Thread.currentThread().getId());
} catch (Throwable e) {
if (e instanceof IOException) {
setStatus(ExecuteThreadStatus.END);
/*
* CAS disconnects socket
* 1) end of the procedure successfully by calling jsp_close_internal_connection
Expand All @@ -237,7 +217,6 @@ public void run() {
*/
break;
} else {
setStatus(ExecuteThreadStatus.ERROR);
Throwable throwable = e;
if (e instanceof InvocationTargetException) {
throwable = ((InvocationTargetException) e).getTargetException();
Expand Down Expand Up @@ -276,8 +255,6 @@ private Header listenCommand() throws Exception {
unpacker.getCurrentPosition(),
unpacker.getCurrentLimit() - unpacker.getCurrentPosition());
ctx.getInboundQueue().add(payloadBuffer);

setStatus(ExecuteThreadStatus.IDLE);
return header;
}

Expand Down Expand Up @@ -317,17 +294,11 @@ private void processStoredProcedure() throws Exception {
unpacker.setBuffer(ctx.getInboundQueue().take());
long id = unpacker.unpackBigint();

setStatus(ExecuteThreadStatus.PARSE);
StoredProcedure procedure = makeStoredProcedure(unpacker);

setStatus(ExecuteThreadStatus.INVOKE);
Value result = procedure.invoke();

/* send results */
setStatus(ExecuteThreadStatus.RESULT);
sendResult(result, procedure);

setStatus(ExecuteThreadStatus.IDLE);
}

private StoredProcedure makeStoredProcedure(CUBRIDUnpacker unpacker) throws Exception {
Expand Down
52 changes: 0 additions & 52 deletions src/jsp/com/cubrid/jsp/ExecuteThreadStatus.java

This file was deleted.

0 comments on commit c03d08a

Please sign in to comment.