diff --git a/README.md b/README.md index b176979f0..5de0bcb75 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![jstorm](http://jstorm.io/img/jstorm-small.jpg) -Please refer to http://jstorm.io for all documents +Please refer to [http://jstorm.io](http://120.25.204.125) for all documents # Getting help diff --git a/docs/jstorm-doc/deploy.bat b/docs/jstorm-doc/deploy.bat new file mode 100644 index 000000000..f4474fd48 --- /dev/null +++ b/docs/jstorm-doc/deploy.bat @@ -0,0 +1,80 @@ +::############################################################################### +:: 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. +::############################################################################### + +@echo off +:start +call jekyll -version >nul 2>&1 +if "%errorlevel%"=="0" goto check_redcarpet +echo ERROR: Could not find jekyll. +echo Please install with 'gem install jekyll' (see http://jekyllrb.com). +exit /b 1 + +:check_redcarpet +call redcarpet -version >nul 2>&1 +if "%errorlevel%"=="0" goto check_pygments +echo ERROR: Could not find redcarpet. +echo Please install with 'gem install redcarpet' (see https://github.com/vmg/redcarpet). +echo Redcarpet is needed for Markdown parsing and table of contents generation. +exit /b 1 + +:check_pygments +call python -c "import pygments" >nul 2>&1 +if "%errorlevel%"=="0" goto check_git +echo ERROR: Could not find pygments. +echo Please install with 'sudo easy_install Pygments' (requires Python; see http://pygments.org). +echo Pygments is needed for syntax highlighting of the code examples. +exit /b 1 + +:check_git +call git --version >nul 2>&1 +if "%errorlevel%"=="0" goto execute +echo ERROR: Could not find Git. +echo Please install Git and add it into $PATH. +echo Git is needed for auto-deploy. +exit /b 1 + +:execute +SET "DOCS_SRC=%cd%" +SET "DOCS_DST=%DOCS_SRC%\_site" +SET "DEPLOY_DATE=%date:~0,10% %time:~0,2%:%time:~3,2%" + +::build doc +echo Start to build doc by Jekyll... +call jekyll build >nul 2>&1 +echo Build complete... + +::push pages to github.com +echo Setting up Git deployment... +call rm -rf .deploy_tmp +call mkdir .deploy_tmp +call cp -r _site/* .deploy_tmp/ >nul 2>&1 +echo Deploying... +call cd .deploy_tmp +call rm -rf jekyll/ +call rm deploy.bat +call git config --global http.postBuffer 8528000 >nul 2>&1 +call git init >nul 2>&1 +call git add -A >nul 2>&1 +call git commit -m "updated: %DEPLOY_DATE%" >nul 2>&1 +call git push -u https://github.com/alibaba/jstorm.git HEAD:documents --force +call cd .. +call rm -rf .deploy_tmp +echo Deploy successfully! +echo Press any key to exit +pause >nul 2>&1 +exit \ No newline at end of file diff --git a/docs/jstorm-doc/deploy.sh b/docs/jstorm-doc/deploy.sh new file mode 100644 index 000000000..ed8fa7d15 --- /dev/null +++ b/docs/jstorm-doc/deploy.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +HAS_JEKYLL=true + +command -v jekyll > /dev/null +if [ $? -ne 0 ]; then + echo -n "ERROR: Could not find jekyll. " + echo "Please install with 'gem install jekyll' (see http://jekyllrb.com)." + + HAS_JEKYLL=false + exit +fi + +command -v redcarpet > /dev/null +if [ $? -ne 0 ]; then + echo -n "WARN: Could not find redcarpet. " + echo -n "Please install with 'sudo gem install redcarpet' (see https://github.com/vmg/redcarpet). " + echo "Redcarpet is needed for Markdown parsing and table of contents generation." +fi + +command -v pygmentize > /dev/null +if [ $? -ne 0 ]; then + echo -n "WARN: Could not find pygments. " + echo -n "Please install with 'sudo easy_install Pygments' (requires Python; see http://pygments.org). " + echo "Pygments is needed for syntax highlighting of the code examples." +fi + +echo "Start to build doc by Jekyll..." +jekyll build > /dev/null +echo "Build complete..." + +echo "Setting up Git deployment..." +rm -rf .deploy_tmp +mkdir .deploy_tmp +cp -r _site/* .deploy_tmp/ > /dev/null +echo "Deploying..." +cd .deploy_tmp +rm -rf jekyll/ +rm deploy.bat +git config --global http.postBuffer 8528000 > /dev/null +git init > /dev/null +git add -A > /dev/null +git commit -m "updated documents" > /dev/null +git push -u https://github.com/alibaba/jstorm.git HEAD:documents --force +cd .. +rm -rf .deploy_tmp +echo "Deploy successfully!" \ No newline at end of file diff --git a/docs/jstorm-doc/quickstart/Compile.md b/docs/jstorm-doc/quickstart/Compile.md index eaa12aef7..ca01acfdb 100644 --- a/docs/jstorm-doc/quickstart/Compile.md +++ b/docs/jstorm-doc/quickstart/Compile.md @@ -3,7 +3,7 @@ title: "Build JStorm Source Code" # Top-level navigation top-nav-group: QuickStart top-nav-pos: 6 -top-nav-title: Comple JStorm +top-nav-title: Compile JStorm --- * This will be replaced by the TOC @@ -25,4 +25,4 @@ Build install tar ``` mvn package assembly:assembly -``` \ No newline at end of file +``` diff --git a/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/Supervisor.java b/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/Supervisor.java index 11f030bce..90a355678 100644 --- a/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/Supervisor.java +++ b/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/supervisor/Supervisor.java @@ -119,7 +119,7 @@ public SupervisorManger mkSupervisor(Map conf, IContext sharedContext) throws Ex // Step 5 create HeartBeat // every supervisor.heartbeat.frequency.secs, write SupervisorInfo to ZK - // sync hearbeat to nimbus + // sync heartbeat to nimbus Heartbeat hb = new Heartbeat(conf, stormClusterState, supervisorId, localState, checkStatus); hb.update(); AsyncLoopThread heartbeat = new AsyncLoopThread(hb, false, null, Thread.MIN_PRIORITY, true); diff --git a/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/hearbeat/SyncContainerHb.java b/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/hearbeat/SyncContainerHb.java index ab4213fe5..812b77c97 100644 --- a/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/hearbeat/SyncContainerHb.java +++ b/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/hearbeat/SyncContainerHb.java @@ -75,7 +75,7 @@ public void checkNoContainerHbTimes() { } } - public void handlReadDir() { + public void handleReadDir() { if (StringUtils.isBlank(readDir) == true) { return; } @@ -180,7 +180,7 @@ public void run() { handleWriteDir(); - handlReadDir(); + handleReadDir(); } diff --git a/jstorm-utility/jstorm-kafka/src/main/java/com/alibaba/jstorm/kafka/PartitionConsumer.java b/jstorm-utility/jstorm-kafka/src/main/java/com/alibaba/jstorm/kafka/PartitionConsumer.java index 7dbc77654..caabc05d0 100644 --- a/jstorm-utility/jstorm-kafka/src/main/java/com/alibaba/jstorm/kafka/PartitionConsumer.java +++ b/jstorm-utility/jstorm-kafka/src/main/java/com/alibaba/jstorm/kafka/PartitionConsumer.java @@ -124,8 +124,12 @@ private void fillMessages() { ByteBufferMessageSet msgs; try { long start = System.currentTimeMillis(); - msgs = consumer.fetchMessages(partition, emittingOffset + 1); - + if(config.fromBeginning){ + msgs = consumer.fetchMessages(partition, emittingOffset); + }else { + msgs = consumer.fetchMessages(partition, emittingOffset + 1); + } + if (msgs == null) { short fetchResponseCode = consumer.getAndResetFetchResponseCode(); if (fetchResponseCode == ErrorMapping.OffsetOutOfRangeCode()) {