mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
refactor: Use Java standard library instead of Guava (#3708)
Co-authored-by: Moderne <team@moderne.io> Co-authored-by: Moderne <team@moderne.io>
This commit is contained in:
committed by
GitHub
parent
9e11c3c018
commit
de95a6a128
@@ -194,7 +194,7 @@ public class FileMixedMetaManager extends MemoryMetaManager implements CanalMeta
|
||||
synchronized (destination.intern()) { // 基于destination控制一下并发更新
|
||||
data.setDestination(destination);
|
||||
|
||||
List<FileMetaClientIdentityData> clientDatas = Lists.newArrayList();
|
||||
List<FileMetaClientIdentityData> clientDatas = new ArrayList<>();
|
||||
List<ClientIdentity> clientIdentitys = destinations.get(destination);
|
||||
for (ClientIdentity clientIdentity : clientIdentitys) {
|
||||
FileMetaClientIdentityData clientData = new FileMetaClientIdentityData();
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.alibaba.otter.canal.meta;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import com.alibaba.otter.canal.common.AbstractCanalLifeCycle;
|
||||
@@ -35,7 +32,7 @@ public class MemoryMetaManager extends AbstractCanalLifeCycle implements CanalMe
|
||||
|
||||
cursors = new MapMaker().makeMap();
|
||||
|
||||
destinations = MigrateMap.makeComputingMap(destination -> Lists.newArrayList());
|
||||
destinations = MigrateMap.makeComputingMap(destination -> new ArrayList<>());
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
@@ -186,8 +183,8 @@ public class MemoryMetaManager extends AbstractCanalLifeCycle implements CanalMe
|
||||
|
||||
public synchronized Map<Long, PositionRange> listAllPositionRange() {
|
||||
Set<Long> batchIdSets = batches.keySet();
|
||||
List<Long> batchIds = Lists.newArrayList(batchIdSets);
|
||||
Collections.sort(Lists.newArrayList(batchIds));
|
||||
List<Long> batchIds = new ArrayList<>(batchIdSets);
|
||||
Collections.sort(new ArrayList<>(batchIds));
|
||||
|
||||
return Maps.newHashMap(batches);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user