[cleanup](fe) cleanup useless code. (#16129)

* [cleanup](Nereids): cleanup useless code.

* revert ErrorCode.java
This commit is contained in:
jakevin
2023-01-28 18:44:43 +08:00
committed by GitHub
parent 7cf7706eb1
commit 7e7fd5d049
18 changed files with 5 additions and 143 deletions

View File

@ -1096,51 +1096,6 @@ public class ScalarType extends Type {
return PrimitiveType.isImplicitCast(type.getPrimitiveType(), targetType.getPrimitiveType());
}
@Override
public int getStorageLayoutBytes() {
switch (type) {
case BOOLEAN:
case TINYINT:
return 1;
case SMALLINT:
return 2;
case INT:
case FLOAT:
case DECIMAL32:
return 4;
case BIGINT:
case TIME:
case DATETIME:
// TODO(Gabriel): unify execution engine and storage engine
case TIMEV2:
case DATETIMEV2:
case DECIMAL64:
return 8;
case LARGEINT:
case DECIMALV2:
case DECIMAL128:
return 16;
case DOUBLE:
return 12;
case DATEV2:
case DATE:
return 3;
case CHAR:
case VARCHAR:
return len;
case HLL:
return 16385;
case BITMAP:
return 1024; // this is a estimated value
case QUANTILE_STATE:
return 1024; // TODO(weixiang): no used in FE, figure out whether can delete this funcion?
case STRING:
return 1024;
default:
return 0;
}
}
@Override
public TColumnType toColumnTypeThrift() {
TColumnType thrift = new TColumnType();

View File

@ -1704,13 +1704,9 @@ public abstract class Type {
}
}
public int getStorageLayoutBytes() {
return 0;
}
public int getIndexSize() {
if (this.getPrimitiveType() == PrimitiveType.CHAR) {
return ((ScalarType) this).getLength();
return this.getLength();
} else {
return this.getPrimitiveType().getOlapColumnIndexSize();
}

View File

@ -35,11 +35,6 @@ public class ExprId extends Id<ExprId> {
public ExprId getNextId() {
return new ExprId(nextId++);
}
@Override
public ExprId getMaxId() {
return new ExprId(nextId - 1);
}
};
}
}

View File

@ -34,11 +34,6 @@ public class SlotId extends Id<SlotId> {
public SlotId getNextId() {
return new SlotId(nextId++);
}
@Override
public SlotId getMaxId() {
return new SlotId(nextId - 1);
}
};
}
}

View File

@ -37,11 +37,6 @@ public class TupleId extends Id<TupleId> {
public TupleId getNextId() {
return new TupleId(nextId++);
}
@Override
public TupleId getMaxId() {
return new TupleId(nextId - 1);
}
};
}
}

View File

@ -68,10 +68,6 @@ public class ErrorReport {
throw new DdlException(reportCommon(pattern, errorCode, objs));
}
public static void report(String pattern, Object... objs) {
report(pattern, ErrorCode.ERR_UNKNOWN_ERROR, objs);
}
public static void report(ErrorCode errorCode, Object... objs) {
report(null, errorCode, objs);
}

View File

@ -28,6 +28,4 @@ public abstract class IdGenerator<IdType extends Id<IdType>> {
protected int nextId = 0;
public abstract IdType getNextId();
public abstract IdType getMaxId();
}

View File

@ -24,7 +24,6 @@ import org.apache.doris.thrift.TStatusCode;
public class Status {
public static final Status OK = new Status();
public static final Status CANCELLED = new Status(TStatusCode.CANCELLED, "Cancelled");
public static final Status THRIFT_RPC_ERROR = new Status(TStatusCode.THRIFT_RPC_ERROR, "Thrift RPC failed");
public TStatusCode getErrorCode() {
return errorCode;

View File

@ -141,12 +141,7 @@ public class ThriftServer {
ThriftServerEventProcessor eventProcessor = new ThriftServerEventProcessor(this);
server.setServerEventHandler(eventProcessor);
serverThread = new Thread(new Runnable() {
@Override
public void run() {
server.serve();
}
});
serverThread = new Thread(() -> server.serve());
serverThread.setDaemon(true);
serverThread.start();
}

View File

@ -153,7 +153,7 @@ public class CooldownHandler extends MasterDaemon {
}
public void replayCooldownJob(CooldownJob cooldownJob) {
CooldownJob replayCooldownJob = null;
CooldownJob replayCooldownJob;
if (!runableCooldownJobs.containsKey(cooldownJob.getJobId())) {
replayCooldownJob = new CooldownJob(cooldownJob.jobId, cooldownJob.getCooldownConfList(),
cooldownJob.timeoutMs);

View File

@ -269,7 +269,7 @@ public class CooldownJob implements Writable {
replayCreateJob(replayedJob);
break;
case SEND_CONF:
replayPengingJob();
replayPendingJob();
break;
case FINISHED:
replayRunningJob(replayedJob);
@ -321,7 +321,7 @@ public class CooldownJob implements Writable {
/**
* Replay job in PENDING state. set cooldown type in Replica
*/
private void replayPengingJob() throws CooldownException {
private void replayPendingJob() throws CooldownException {
for (CooldownConf cooldownConf : cooldownConfList) {
setCooldownReplica(cooldownConf.getDbId(), cooldownConf.getTableId(), cooldownConf.getPartitionId(),
cooldownConf.getIndexId(), cooldownConf.getTabletId(), cooldownConf.getCooldownReplicaId(),

View File

@ -1,32 +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.datasource;
/**
* MetaObjCache caches and manages all meta objects fetched from external catalogs.
* So that we don't need to get meta objects every time.
*/
public class MetaObjCache {
private static class SingletonHolder {
private static final MetaObjCache INSTANCE = new MetaObjCache();
}
public static MetaObjCache get() {
return SingletonHolder.INSTANCE;
}
}

View File

@ -39,11 +39,6 @@ public class GroupId extends Id<GroupId> {
public GroupId getNextId() {
return new GroupId(nextId++);
}
@Override
public GroupId getMaxId() {
return new GroupId(nextId - 1);
}
};
}

View File

@ -52,11 +52,6 @@ public class ExprId extends Id<ExprId> {
public ExprId getNextId() {
return new ExprId(nextId++);
}
@Override
public ExprId getMaxId() {
return new ExprId(nextId++);
}
};
}

View File

@ -51,11 +51,6 @@ public class RelationId extends Id<RelationId> {
public RelationId getNextId() {
return new RelationId(nextId++);
}
@Override
public RelationId getMaxId() {
return new RelationId(nextId);
}
};
}

View File

@ -34,11 +34,6 @@ public class PlanFragmentId extends Id<PlanFragmentId> {
public PlanFragmentId getNextId() {
return new PlanFragmentId(nextId++);
}
@Override
public PlanFragmentId getMaxId() {
return new PlanFragmentId(nextId - 1);
}
};
}

View File

@ -34,11 +34,6 @@ public class PlanNodeId extends Id<PlanNodeId> {
public PlanNodeId getNextId() {
return new PlanNodeId(nextId++);
}
@Override
public PlanNodeId getMaxId() {
return new PlanNodeId(nextId - 1);
}
};
}

View File

@ -32,11 +32,6 @@ public class RuntimeFilterId extends Id<RuntimeFilterId> {
public RuntimeFilterId getNextId() {
return new RuntimeFilterId(nextId++);
}
@Override
public RuntimeFilterId getMaxId() {
return new RuntimeFilterId(nextId - 1);
}
};
}