提交 aa535dd3 编写于 作者: Y yukon 提交者: dongeforever

[ROCKETMQ-139] Degrade the client related modules' JDK version to 1.6

上级 68ebb780
......@@ -22,12 +22,16 @@
<version>4.1.0-incubating-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>rocketmq-client</artifactId>
<name>rocketmq-client ${project.version}</name>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
......
......@@ -133,7 +133,7 @@ public class DefaultMQPushConsumer extends ClientConfig implements MQPushConsume
/**
* Subscription relationship
*/
private Map<String /* topic */, String /* sub expression */> subscription = new HashMap<>();
private Map<String /* topic */, String /* sub expression */> subscription = new HashMap<String, String>();
/**
* Message listener
......
......@@ -842,7 +842,11 @@ public class MQClientInstance {
try {
this.mQClientAPIImpl.unregisterClient(addr, this.clientId, producerGroup, consumerGroup, 3000);
log.info("unregister client[Producer: {} Consumer: {}] from broker[{} {} {}] success", producerGroup, consumerGroup, brokerName, entry1.getKey(), addr);
} catch (RemotingException | InterruptedException | MQBrokerException e) {
} catch (RemotingException e) {
log.error("unregister client exception from broker: " + addr, e);
} catch (InterruptedException e) {
log.error("unregister client exception from broker: " + addr, e);
} catch (MQBrokerException e) {
log.error("unregister client exception from broker: " + addr, e);
}
}
......
......@@ -99,7 +99,7 @@ public class DefaultMQPullConsumerTest {
assertThat(pullResult.getNextBeginOffset()).isEqualTo(1024 + 1);
assertThat(pullResult.getMinOffset()).isEqualTo(123);
assertThat(pullResult.getMaxOffset()).isEqualTo(2048);
assertThat(pullResult.getMsgFoundList()).isEqualTo(new ArrayList<>());
assertThat(pullResult.getMsgFoundList()).isEqualTo(new ArrayList<Object>());
}
@Test
......@@ -137,7 +137,7 @@ public class DefaultMQPullConsumerTest {
assertThat(pullResult.getNextBeginOffset()).isEqualTo(1024 + 1);
assertThat(pullResult.getMinOffset()).isEqualTo(123);
assertThat(pullResult.getMaxOffset()).isEqualTo(2048);
assertThat(pullResult.getMsgFoundList()).isEqualTo(new ArrayList<>());
assertThat(pullResult.getMsgFoundList()).isEqualTo(new ArrayList<Object>());
}
@Override public void onException(Throwable e) {
......
......@@ -143,7 +143,7 @@ public class DefaultMQPushConsumerTest {
doReturn(new FindBrokerResult("127.0.0.1:10911", false)).when(mQClientFactory).findBrokerAddressInSubscribe(anyString(), anyLong(), anyBoolean());
doReturn(Collections.singletonList(mQClientFactory.getClientId())).when(mQClientFactory).findConsumerIdList(anyString(), anyString());
Set<MessageQueue> messageQueueSet = new HashSet<>();
Set<MessageQueue> messageQueueSet = new HashSet<MessageQueue>();
messageQueueSet.add(createPullRequest().getMessageQueue());
pushConsumer.getDefaultMQPushConsumerImpl().updateTopicSubscribeInfo(topic, messageQueueSet);
doReturn(123L).when(rebalancePushImpl).computePullFromWhere(any(MessageQueue.class));
......
......@@ -69,7 +69,7 @@ public class LocalFileOffsetStoreTest {
offsetStore.updateOffset(messageQueue, 1024, false);
assertThat(offsetStore.readOffset(messageQueue, ReadOffsetType.READ_FROM_STORE)).isEqualTo(-1);
offsetStore.persistAll(new HashSet<>(Collections.singletonList(messageQueue)));
offsetStore.persistAll(new HashSet<MessageQueue>(Collections.singletonList(messageQueue)));
assertThat(offsetStore.readOffset(messageQueue, ReadOffsetType.READ_FROM_STORE)).isEqualTo(1024);
}
}
\ No newline at end of file
......@@ -119,7 +119,7 @@ public class RemoteBrokerOffsetStoreTest {
assertThat(offsetStore.readOffset(messageQueue, ReadOffsetType.READ_FROM_STORE)).isEqualTo(1023);
offsetStore.updateOffset(messageQueue, 1025, false);
offsetStore.persistAll(new HashSet<>(Collections.singletonList(messageQueue)));
offsetStore.persistAll(new HashSet<MessageQueue>(Collections.singletonList(messageQueue)));
assertThat(offsetStore.readOffset(messageQueue, ReadOffsetType.READ_FROM_STORE)).isEqualTo(1025);
}
......
......@@ -48,17 +48,17 @@ public class MQClientInstanceTest {
TopicRouteData topicRouteData = new TopicRouteData();
topicRouteData.setFilterServerTable(new HashMap<String, List<String>>());
List<BrokerData> brokerDataList = new ArrayList<>();
List<BrokerData> brokerDataList = new ArrayList<BrokerData>();
BrokerData brokerData = new BrokerData();
brokerData.setBrokerName("BrokerA");
brokerData.setCluster("DefaultCluster");
HashMap<Long, String> brokerAddrs = new HashMap<>();
HashMap<Long, String> brokerAddrs = new HashMap<Long, String>();
brokerAddrs.put(0L, "127.0.0.1:10911");
brokerData.setBrokerAddrs(brokerAddrs);
brokerDataList.add(brokerData);
topicRouteData.setBrokerDatas(brokerDataList);
List<QueueData> queueDataList = new ArrayList<>();
List<QueueData> queueDataList = new ArrayList<QueueData>();
QueueData queueData = new QueueData();
queueData.setBrokerName("BrokerA");
queueData.setPerm(6);
......
......@@ -194,17 +194,17 @@ public class DefaultMQProducerTest {
TopicRouteData topicRouteData = new TopicRouteData();
topicRouteData.setFilterServerTable(new HashMap<String, List<String>>());
List<BrokerData> brokerDataList = new ArrayList<>();
List<BrokerData> brokerDataList = new ArrayList<BrokerData>();
BrokerData brokerData = new BrokerData();
brokerData.setBrokerName("BrokerA");
brokerData.setCluster("DefaultCluster");
HashMap<Long, String> brokerAddrs = new HashMap<>();
HashMap<Long, String> brokerAddrs = new HashMap<Long, String>();
brokerAddrs.put(0L, "127.0.0.1:10911");
brokerData.setBrokerAddrs(brokerAddrs);
brokerDataList.add(brokerData);
topicRouteData.setBrokerDatas(brokerDataList);
List<QueueData> queueDataList = new ArrayList<>();
List<QueueData> queueDataList = new ArrayList<QueueData>();
QueueData queueData = new QueueData();
queueData.setBrokerName("BrokerA");
queueData.setPerm(6);
......
......@@ -34,7 +34,7 @@ public class SelectMessageQueueByHashTest {
Message message = new Message(topic, new byte[] {});
List<MessageQueue> messageQueues = new ArrayList<>();
List<MessageQueue> messageQueues = new ArrayList<MessageQueue>();
for (int i = 0; i < 10; i++) {
MessageQueue messageQueue = new MessageQueue(topic, "DefaultBroker", i);
messageQueues.add(messageQueue);
......
......@@ -27,6 +27,10 @@
<artifactId>rocketmq-common</artifactId>
<name>rocketmq-common ${project.version}</name>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
......
......@@ -256,7 +256,7 @@ public class MixAll {
if (null == value) {
value = "";
}
} catch (IllegalArgumentException | IllegalAccessException e) {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
......@@ -313,7 +313,7 @@ public class MixAll {
try {
field.setAccessible(true);
value = field.get(object);
} catch (IllegalArgumentException | IllegalAccessException e) {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
......
......@@ -59,9 +59,9 @@ public class MixAllTest {
file.delete();
}
file.createNewFile();
try (PrintWriter out = new PrintWriter(fileName)) {
out.write("TestForMixAll");
}
PrintWriter out = new PrintWriter(fileName);
out.write("TestForMixAll");
out.close();
String string = MixAll.file2String(fileName);
assertThat(string).isEqualTo("TestForMixAll");
file.delete();
......
......@@ -36,7 +36,7 @@ public class FilterAPITest {
assertThat(subscriptionData.getTopic()).isEqualTo(topic);
assertThat(subscriptionData.getSubString()).isEqualTo(subString);
String [] tags = subString.split("\\|\\|");
Set<String> tagSet = new HashSet<>();
Set<String> tagSet = new HashSet<String>();
for (String tag : tags) {
tagSet.add(tag.trim());
}
......
......@@ -27,6 +27,10 @@
<artifactId>rocketmq-remoting</artifactId>
<name>rocketmq-remoting ${project.version}</name>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
......
......@@ -73,12 +73,12 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
private final Bootstrap bootstrap = new Bootstrap();
private final EventLoopGroup eventLoopGroupWorker;
private final Lock lockChannelTables = new ReentrantLock();
private final ConcurrentHashMap<String /* addr */, ChannelWrapper> channelTables = new ConcurrentHashMap<>();
private final ConcurrentHashMap<String /* addr */, ChannelWrapper> channelTables = new ConcurrentHashMap<String, ChannelWrapper>();
private final Timer timer = new Timer("ClientHouseKeepingService", true);
private final AtomicReference<List<String>> namesrvAddrList = new AtomicReference<>();
private final AtomicReference<String> namesrvAddrChoosed = new AtomicReference<>();
private final AtomicReference<List<String>> namesrvAddrList = new AtomicReference<List<String>>();
private final AtomicReference<String> namesrvAddrChoosed = new AtomicReference<String>();
private final AtomicInteger namesrvIndex = new AtomicInteger(initValueIndex());
private final Lock lockNamesrvChannel = new ReentrantLock();
......@@ -522,7 +522,7 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
executorThis = this.publicExecutor;
}
Pair<NettyRequestProcessor, ExecutorService> pair = new Pair<>(processor, executorThis);
Pair<NettyRequestProcessor, ExecutorService> pair = new Pair<NettyRequestProcessor, ExecutorService>(processor, executorThis);
this.processorTable.put(requestCode, pair);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册