[CleanUp](FE): cleanup useless code in FE. (#16058)

This commit is contained in:
jakevin
2023-01-18 22:25:41 +08:00
committed by GitHub
parent baf62b4418
commit 2acf634f84
6 changed files with 0 additions and 289 deletions

View File

@ -1,96 +0,0 @@
// 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.doris.clone;
public class BackendInfo {
private long backendId;
private String host;
private long totalCapacityB;
private long availableCapacityB;
// capacity for clone
private long cloneCapacityB;
private int tableReplicaNum;
// replica num for clone
private int cloneReplicaNum;
public BackendInfo(String host, long backendId, long totalCapacityB, long availableCapacityB) {
this.backendId = backendId;
this.totalCapacityB = totalCapacityB;
this.availableCapacityB = availableCapacityB;
this.host = host;
this.cloneCapacityB = 0L;
this.tableReplicaNum = 0;
this.cloneReplicaNum = 0;
}
public String getHost() {
return host;
}
public long getBackendId() {
return backendId;
}
public long getTotalCapacityB() {
return totalCapacityB;
}
public long getAvailableCapacityB() {
return availableCapacityB;
}
public void setCloneCapacityB(long cloneCapacityB) {
this.cloneCapacityB = cloneCapacityB;
}
public boolean canCloneByCapacity(long tabletSizeB) {
if (cloneCapacityB <= tabletSizeB) {
return false;
}
return true;
}
public void decreaseCloneCapacityB(long tabletSizeB) {
cloneCapacityB -= tabletSizeB;
}
public int getTableReplicaNum() {
return tableReplicaNum;
}
public void setTableReplicaNum(int tableReplicaNum) {
this.tableReplicaNum = tableReplicaNum;
}
public void setCloneReplicaNum(int cloneReplicaNum) {
this.cloneReplicaNum = cloneReplicaNum;
}
public boolean canCloneByDistribution() {
if (cloneReplicaNum <= 1) {
return false;
}
return true;
}
public void decreaseCloneReplicaNum() {
cloneReplicaNum -= 1;
}
}

View File

@ -1,100 +0,0 @@
// 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.doris.clone;
import org.apache.doris.catalog.Database;
import java.util.Set;
public class CloneTabletInfo {
private long dbId;
private long tableId;
private long partitionId;
private long indexId;
private long tabletId;
private short replicationNum;
private short onlineReplicaNum;
private long tabletSizeB;
private Set<Long> backendIds;
private Database.DbState dbState;
public CloneTabletInfo(long dbId, long tableId, long partitionId, long indexId, long tabletId, short replicationNum,
short onlineReplicaNum, long tabletSizeB, Set<Long> backendIds) {
this.dbId = dbId;
this.tableId = tableId;
this.partitionId = partitionId;
this.indexId = indexId;
this.tabletId = tabletId;
this.replicationNum = replicationNum;
this.onlineReplicaNum = onlineReplicaNum;
this.tabletSizeB = tabletSizeB;
this.backendIds = backendIds;
this.dbState = Database.DbState.NORMAL;
}
public long getDbId() {
return dbId;
}
public long getTableId() {
return tableId;
}
public long getPartitionId() {
return partitionId;
}
public long getIndexId() {
return indexId;
}
public long getTabletId() {
return tabletId;
}
public short getReplicationNum() {
return replicationNum;
}
public short getOnlineReplicaNum() {
return onlineReplicaNum;
}
public long getTabletSizeB() {
return tabletSizeB;
}
public Set<Long> getBackendIds() {
return backendIds;
}
@Override
public String toString() {
return "TabletInfo [dbId=" + dbId + ", tableId=" + tableId + ", partitionId=" + partitionId + ", indexId="
+ indexId + ", tabletId=" + tabletId + ", replicationNum=" + replicationNum + ", onlineReplicaNum="
+ onlineReplicaNum + ", tabletSizeB=" + tabletSizeB + ", backendIds=" + backendIds + "]";
}
public Database.DbState getDbState() {
return dbState;
}
public void setDbState(Database.DbState dbState) {
this.dbState = dbState;
}
}

View File

@ -1,55 +0,0 @@
// 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.doris.rpc;
import org.apache.thrift.TBase;
import org.apache.thrift.TDeserializer;
import org.apache.thrift.TException;
import org.apache.thrift.TSerializer;
// used to compatible with our older thrift protocol
public class AttachmentRequest {
protected byte[] serializedRequest;
protected byte[] serializedResult;
public void setRequest(TBase request) throws TException {
TSerializer serializer = new TSerializer();
serializedRequest = serializer.serialize(request);
}
public void setSerializedRequest(byte[] request) {
this.serializedRequest = request;
}
public byte[] getSerializedRequest() {
return serializedRequest;
}
public void setSerializedResult(byte[] result) {
this.serializedResult = result;
}
public byte[] getSerializedResult() {
return serializedResult;
}
public void getResult(TBase result) throws TException {
TDeserializer deserializer = new TDeserializer();
deserializer.deserialize(result, serializedResult);
}
}

View File

@ -125,7 +125,6 @@ public class GlobalTransactionMgr implements Writable {
* @param coordinator
* @throws BeginTransactionException
* @throws DuplicatedRequestException
* @throws IllegalTransactionParameterException
*/
public long beginTransaction(long dbId, List<Long> tableIdList, String label, TUniqueId requestId,
TxnCoordinator coordinator, LoadJobSourceType sourceType, long listenerId, long timeoutSecond)

View File

@ -1,33 +0,0 @@
// 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.doris.transaction;
import org.apache.doris.common.UserException;
public class IllegalTransactionParameterException extends UserException {
private static final long serialVersionUID = 1L;
public IllegalTransactionParameterException(String msg) {
super(msg);
}
public IllegalTransactionParameterException(String msg, Throwable e) {
super(msg, e);
}
}

View File

@ -25,7 +25,6 @@ public interface TxnStateChangeCallback {
/**
* this interface is executed before txn committed, it will check if txn could be commit
* @param txnState
* @throws TransactionException if transaction could not be commit or there are some exception before committed,
* it will throw this exception. The txn will be committed failed.
*/
@ -34,7 +33,6 @@ public interface TxnStateChangeCallback {
/**
* this interface is executed before txn aborted, it will check if txn could be abort
*
* @param txnState
* @throws TransactionException if transaction could not be abort or there are some exception before aborted,
* it will throw this exception. The txn will be aborted failed.
*/
@ -52,10 +50,8 @@ public interface TxnStateChangeCallback {
/**
* this interface is executed when transaction has been aborted
*
* @param txnState
* @param txnStatusChangeReason
* maybe null
* @return
*/
void afterAborted(TransactionState txnState, boolean txnOperated,
String txnStatusChangeReason) throws UserException;