Skip to content

Commit

Permalink
Fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Jul 26, 2013
2 parents bc32acf + 478beab commit 415e112
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![Logo](http://photo.yupoo.com/killme2008/CLRQoBA9/medish.jpg)

#新闻
* MetaQ 1.4.6.2发布。[更新日志](https://github.com/killme2008/Metamorphosis/wiki/ReleaseNotes)
* MetaQ 1.4.6.1发布。[更新日志](https://github.com/killme2008/Metamorphosis/wiki/ReleaseNotes)
* MetaQ 1.4.5.1发布。[更新日志](https://github.com/killme2008/Metamorphosis/wiki/ReleaseNotes)
* MetaQ 1.4.5发布。[更新日志](https://github.com/killme2008/Metamorphosis/wiki/ReleaseNotes)
Expand Down
2 changes: 1 addition & 1 deletion metamorphosis-client-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion metamorphosis-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>metamorphosis-client</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,37 @@ public synchronized void closeWithRef(final String url, Object ref, final boolea
if (refs != null) {
refs.remove(ref);
if (refs.isEmpty() || this.isOnlyMe(refs)) {
this.remotingClient.close(url, allowReconnect);
int times = 0;
while (times++ < 3) {
try {
this.remotingClient.close(url, allowReconnect);
this.remotingClient.awaitClosed(url, 5000);
break;
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
catch (TimeoutException e) {
// ignore
}
}
}
}
}


@Override
public void awaitClosed(String arg0, long arg1) throws InterruptedException, TimeoutException {
this.remotingClient.awaitClosed(arg0, arg1);
}


@Override
public void awaitClosed(String arg0) throws InterruptedException, TimeoutException {
this.remotingClient.awaitClosed(arg0);
}


private boolean isOnlyMe(final Set<Object> refs) {
return refs.size() == 1 && refs.contains(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ boolean rebalance() throws InterruptedException, Exception {
this.fetchManager.stopFetchRunner();
// closed all connections to old brokers.
this.closeOldBrokersConnections();
this.commitOffsets();
this.updateFetchRunner(cluster);
this.oldCluster = cluster;
}
Expand Down
2 changes: 1 addition & 1 deletion metamorphosis-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>metamorphosis-commons</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions metamorphosis-dashboard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>metamorphosis-dashboard</artifactId>
Expand Down Expand Up @@ -149,7 +149,7 @@
<dependency>
<groupId>com.taobao.metamorphosis</groupId>
<artifactId>metamorphosis-server</artifactId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ring-mock</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="query-pending-msgs" class="form-search">
<form autocomplete="on" autofill="on">
<form autocomplete="on" autofill="on" onsubmit="return false;">
<legend>Query pending messages for topic <strong>$topic.topic</strong> by consumer group:</legend>
<input placeholder="Consumer group" type="text" name="group" class="input-medium search-query" value="$!group">
<button class="btn">Query</button>
Expand Down
6 changes: 3 additions & 3 deletions metamorphosis-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@
<dependency>
<groupId>com.taobao.metamorphosis</groupId>
<artifactId>metamorphosis-client</artifactId>
<version>1.4.6.1</version>
<version>1.4.6.2</version>
</dependency>
<dependency>
<groupId>com.taobao.metamorphosis</groupId>
<artifactId>metamorphosis-storm-spout</artifactId>
<version>1.4.6.1</version>
<version>1.4.6.2</version>
</dependency>
<dependency>
<groupId>com.taobao.metamorphosis</groupId>
<artifactId>metamorphosis-client-extension</artifactId>
<version>1.4.6.1</version>
<version>1.4.6.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand Down
2 changes: 1 addition & 1 deletion metamorphosis-server-wrapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private void checkTopic2(
private void mockConnect(final String url) throws NotifyRemotingException, InterruptedException {
this.remotingClient.connectWithRef(EasyMock.eq(url), EasyMock.anyObject());
EasyMock.expectLastCall();
this.remotingClient.awaitReadyInterrupt(url, 10000);
this.remotingClient.awaitReadyInterrupt(url, 4000);
EasyMock.expectLastCall();
}

Expand Down
2 changes: 1 addition & 1 deletion metamorphosis-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>metamorphosis-server</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public void setBrokerProcessor(final CommandProcessor brokerProcessor) {

public MetaMorphosisBroker(final MetaConfig metaConfig) {
super();
this.shutdownHook = new ShutdownHook();
Runtime.getRuntime().addShutdownHook(this.shutdownHook);
this.metaConfig = metaConfig;
this.remotingServer = newRemotingServer(metaConfig);
this.executorsManager = new ExecutorsManager(metaConfig);
Expand All @@ -174,8 +176,6 @@ public MetaMorphosisBroker(final MetaConfig metaConfig) {
this.brokerProcessor =
new TransactionalCommandProcessor(metaConfig, this.storeManager, this.idWorker, next, transactionStore,
this.statsManager);
this.shutdownHook = new ShutdownHook();
Runtime.getRuntime().addShutdownHook(this.shutdownHook);
MetaMBeanServer.registMBean(this, null);
}

Expand Down Expand Up @@ -301,7 +301,12 @@ public synchronized void stop() {
}

if (!this.runShutdownHook && this.shutdownHook != null) {
Runtime.getRuntime().removeShutdownHook(this.shutdownHook);
try {
Runtime.getRuntime().removeShutdownHook(this.shutdownHook);
}
catch (Exception e) {
// ignore
}
}

this.brokerProcessor.dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private void loadDataDir(final MetaConfig metaConfig, final File dir) throws IOE
log.warn("Begin to scan data path:" + dir.getAbsolutePath());
final long start = System.currentTimeMillis();
final File[] ls = dir.listFiles();
int nThreads = Runtime.getRuntime().availableProcessors() + 1;
int nThreads = Runtime.getRuntime().availableProcessors() + 2;
ExecutorService executor = Executors.newFixedThreadPool(nThreads);
int count = 0;
List<Callable<MessageStore>> tasks = new ArrayList<Callable<MessageStore>>();
Expand Down Expand Up @@ -354,6 +354,7 @@ public MessageStore call() throws Exception {
else {
this.loadStores(tasks);
}
tasks.clear();
}
}
}
Expand Down Expand Up @@ -384,7 +385,6 @@ private void loadStores(List<Callable<MessageStore>> tasks) throws IOException,
throw new IllegalStateException(e);
}
}
tasks.clear();
}


Expand All @@ -409,7 +409,6 @@ private void loadStoresInParallel(ExecutorService executor, List<Callable<Messag
throw ThreadUtils.launderThrowable(e);
}
}
tasks.clear();
}


Expand Down
2 changes: 1 addition & 1 deletion metamorphosis-storm-spout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metamorphosis作为twitter strom spout数据源的支持项目
<dependency>
<groupId>com.taobao.metamorphosis</groupId>
<artifactId>storm-metamorphosis-spout</artifactId>
<version>1.4.6.1</version>
<version>1.4.6.2</version>
</dependency>

2 changes: 1 addition & 1 deletion metamorphosis-storm-spout/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>metamorphosis-storm-spout</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion metamorphosis-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>metamorphosis-all</artifactId>
<groupId>com.taobao.metamorphosis</groupId>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>metamorphosis-tools v${project.version}</name>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<groupId>com.taobao.metamorphosis</groupId>
<artifactId>metamorphosis-all</artifactId>
<packaging>pom</packaging>
<version>1.4.6.2-SNAPSHOT</version>
<version>1.4.6.3-SNAPSHOT</version>
<name>taobao metamorphosis v${project.version}</name>
<url>https://github.com/killme2008/Metamorphosis</url>
<licenses>
Expand Down Expand Up @@ -196,7 +196,7 @@
<dependency>
<groupId>com.taobao.gecko</groupId>
<artifactId>gecko</artifactId>
<version>1.1.4</version>
<version>1.1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.taobao.notify</groupId>
Expand Down

0 comments on commit 415e112

Please sign in to comment.