forked from apache/iotdb
-
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
14 changed files
with
339 additions
and
203 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
58 changes: 58 additions & 0 deletions
58
...src/main/java/org/apache/iotdb/confignode/consensus/request/read/table/ShowTablePlan.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,58 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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. | ||
*/ | ||
|
||
package org.apache.iotdb.confignode.consensus.request.read.table; | ||
|
||
import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlan; | ||
import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlanType; | ||
|
||
import org.apache.tsfile.utils.ReadWriteIOUtils; | ||
|
||
import java.io.DataOutputStream; | ||
import java.io.IOException; | ||
import java.nio.ByteBuffer; | ||
|
||
public class ShowTablePlan extends ConfigPhysicalPlan { | ||
|
||
private String database; | ||
|
||
public ShowTablePlan() { | ||
super(ConfigPhysicalPlanType.ShowTable); | ||
} | ||
|
||
public ShowTablePlan(final String database) { | ||
super(ConfigPhysicalPlanType.ShowTable); | ||
this.database = database; | ||
} | ||
|
||
public String getDatabase() { | ||
return database; | ||
} | ||
|
||
@Override | ||
protected void serializeImpl(final DataOutputStream stream) throws IOException { | ||
stream.writeShort(getType().getPlanType()); | ||
ReadWriteIOUtils.write(database, stream); | ||
} | ||
|
||
@Override | ||
protected void deserializeImpl(final ByteBuffer buffer) throws IOException { | ||
database = ReadWriteIOUtils.readString(buffer); | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
...ode/src/main/java/org/apache/iotdb/confignode/consensus/response/table/ShowTableResp.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,41 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you 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. | ||
*/ | ||
|
||
package org.apache.iotdb.confignode.consensus.response.table; | ||
|
||
import org.apache.iotdb.common.rpc.thrift.TSStatus; | ||
import org.apache.iotdb.confignode.rpc.thrift.TShowTableResp; | ||
import org.apache.iotdb.confignode.rpc.thrift.TTableInfo; | ||
import org.apache.iotdb.consensus.common.DataSet; | ||
|
||
import java.util.List; | ||
|
||
public class ShowTableResp implements DataSet { | ||
private final TSStatus status; | ||
private final List<TTableInfo> tableInfoList; | ||
|
||
public ShowTableResp(final TSStatus status, final List<TTableInfo> tableInfoList) { | ||
this.status = status; | ||
this.tableInfoList = tableInfoList; | ||
} | ||
|
||
public TShowTableResp convertToTShowTableResp() { | ||
return new TShowTableResp(status).setTableInfoList(tableInfoList); | ||
} | ||
} |
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
Oops, something went wrong.