Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor result set and execution plan interface hierarchies
- Loading branch information
1 parent
8184b8f
commit 2298d3d
Showing
28 changed files
with
222 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
core/src/main/java/com/orientechnologies/orient/core/sql/executor/OExecutionPlan.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,13 +1,16 @@ | |||
package com.orientechnologies.orient.core.sql.executor; | package com.orientechnologies.orient.core.sql.executor; | ||
|
|
||
import java.io.Serializable; | import java.io.Serializable; | ||
import java.util.List; | |||
|
|
||
/** | /** | ||
* Created by luigidellaquila on 06/07/16. | * Created by luigidellaquila on 06/07/16. | ||
*/ | */ | ||
public interface OExecutionPlan extends Serializable{ | public interface OExecutionPlan extends Serializable{ | ||
|
|
||
List<OExecutionStep> getSteps(); | |||
|
|
||
public String prettyPrint(int indent); | String prettyPrint(int indent); | ||
|
|
||
OResult toResult(); | |||
} | } |
34 changes: 8 additions & 26 deletions
34
core/src/main/java/com/orientechnologies/orient/core/sql/executor/OExecutionStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,37 +1,19 @@ | |||
package com.orientechnologies.orient.core.sql.executor; | package com.orientechnologies.orient.core.sql.executor; | ||
|
|
||
import com.orientechnologies.common.concur.OTimeoutException; | import java.util.List; | ||
import com.orientechnologies.orient.core.command.OCommandContext; | |||
|
|
||
/** | /** | ||
* Created by luigidellaquila on 06/07/16. | * Created by luigidellaquila on 20/07/16. | ||
*/ | */ | ||
public interface OExecutionStep extends OExecutionCallback { | public interface OExecutionStep { | ||
|
|
||
OTodoResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException; | String getName(); | ||
|
|
||
void asyncPull(OCommandContext ctx, int nRecords, OExecutionCallback callback) throws OTimeoutException; | String getType(); | ||
|
|
||
void sendTimeout(); | String getTargetNode(); | ||
|
|
||
void setPrevious(OExecutionStep step); | String getDescription(); | ||
|
|
||
void setNext(OExecutionStep step); | List<OExecutionStep> getSubSteps(); | ||
|
|||
void close(); | |||
|
|||
static String getIndent(int depth, int indent) { | |||
StringBuilder result = new StringBuilder(); | |||
for (int i = 0; i < depth; i++) { | |||
for (int j = 0; j < indent; j++) { | |||
result.append(" "); | |||
} | |||
} | |||
return result.toString(); | |||
} | |||
|
|||
default String prettyPrint(int depth, int indent) { | |||
String spaces = getIndent(depth, indent); | |||
return spaces + getClass().getSimpleName(); | |||
} | |||
} | } |
60 changes: 60 additions & 0 deletions
60
.../src/main/java/com/orientechnologies/orient/core/sql/executor/OExecutionStepInternal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,60 @@ | |||
package com.orientechnologies.orient.core.sql.executor; | |||
|
|||
import com.orientechnologies.common.concur.OTimeoutException; | |||
import com.orientechnologies.orient.core.command.OCommandContext; | |||
|
|||
import java.util.Collections; | |||
import java.util.List; | |||
|
|||
/** | |||
* Created by luigidellaquila on 06/07/16. | |||
*/ | |||
public interface OExecutionStepInternal extends OExecutionStep, OExecutionCallback { | |||
|
|||
OTodoResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException; | |||
|
|||
void asyncPull(OCommandContext ctx, int nRecords, OExecutionCallback callback) throws OTimeoutException; | |||
|
|||
void sendTimeout(); | |||
|
|||
void setPrevious(OExecutionStepInternal step); | |||
|
|||
void setNext(OExecutionStepInternal step); | |||
|
|||
void close(); | |||
|
|||
static String getIndent(int depth, int indent) { | |||
StringBuilder result = new StringBuilder(); | |||
for (int i = 0; i < depth; i++) { | |||
for (int j = 0; j < indent; j++) { | |||
result.append(" "); | |||
} | |||
} | |||
return result.toString(); | |||
} | |||
|
|||
default String prettyPrint(int depth, int indent) { | |||
String spaces = getIndent(depth, indent); | |||
return spaces + getClass().getSimpleName(); | |||
} | |||
|
|||
default String getName() { | |||
return getClass().getSimpleName(); | |||
} | |||
|
|||
default String getType() { | |||
return getClass().getSimpleName(); | |||
} | |||
|
|||
default String getDescription() { | |||
return prettyPrint(0, 3); | |||
} | |||
|
|||
default String getTargetNode() { | |||
return "<local>"; | |||
} | |||
|
|||
default List<OExecutionStep> getSubSteps() { | |||
return Collections.EMPTY_LIST; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.