forked from apache/shardingsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
212 additions
and
158 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
40 changes: 40 additions & 0 deletions
40
...va/io/shardingsphere/proxy/backend/common/jdbc/execute/response/ExecuteQueryResponse.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2016-2018 shardingsphere.io. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* </p> | ||
*/ | ||
|
||
package io.shardingsphere.proxy.backend.common.jdbc.execute.response; | ||
|
||
import io.shardingsphere.core.merger.QueryResult; | ||
import io.shardingsphere.proxy.transport.mysql.packet.command.reponse.QueryResponsePackets; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
/** | ||
* Execute query response. | ||
* | ||
* @author zhangliang | ||
*/ | ||
@RequiredArgsConstructor | ||
@Getter | ||
public final class ExecuteQueryResponse implements ExecuteResponse { | ||
|
||
private final QueryResponsePackets queryResponsePackets; | ||
|
||
private final List<QueryResult> queryResults = new LinkedList<>(); | ||
} |
26 changes: 26 additions & 0 deletions
26
...in/java/io/shardingsphere/proxy/backend/common/jdbc/execute/response/ExecuteResponse.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2016-2018 shardingsphere.io. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* </p> | ||
*/ | ||
|
||
package io.shardingsphere.proxy.backend.common.jdbc.execute.response; | ||
|
||
/** | ||
* Execute response. | ||
* | ||
* @author zhangliang | ||
*/ | ||
public interface ExecuteResponse { | ||
} |
51 changes: 51 additions & 0 deletions
51
...a/io/shardingsphere/proxy/backend/common/jdbc/execute/response/ExecuteUpdateResponse.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2016-2018 shardingsphere.io. | ||
* <p> | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* </p> | ||
*/ | ||
|
||
package io.shardingsphere.proxy.backend.common.jdbc.execute.response; | ||
|
||
import io.shardingsphere.proxy.backend.common.jdbc.execute.response.unit.ExecuteResponseUnit; | ||
import io.shardingsphere.proxy.transport.mysql.packet.command.reponse.CommandResponsePackets; | ||
import lombok.Getter; | ||
|
||
import java.util.Collection; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
/** | ||
* Execute update response. | ||
* | ||
* @author zhangliang | ||
*/ | ||
@Getter | ||
public final class ExecuteUpdateResponse implements ExecuteResponse { | ||
|
||
private final List<CommandResponsePackets> packetsList = new LinkedList<>(); | ||
|
||
private final CommandResponsePackets firstPackets; | ||
|
||
public ExecuteUpdateResponse(final CommandResponsePackets packets) { | ||
packetsList.add(packets); | ||
firstPackets = packetsList.iterator().next(); | ||
} | ||
|
||
public ExecuteUpdateResponse(final Collection<ExecuteResponseUnit> responseUnits) { | ||
for (ExecuteResponseUnit each : responseUnits) { | ||
packetsList.add(each.getCommandResponsePackets()); | ||
} | ||
firstPackets = packetsList.iterator().next(); | ||
} | ||
} |
Oops, something went wrong.