Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from alibaba/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
liufengking authored Sep 10, 2016
2 parents b33dd57 + 49d8347 commit 397f6cf
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
80 changes: 80 additions & 0 deletions docs/jstorm-doc/deploy.bat
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions docs/jstorm-doc/deploy.sh
Original file line number Diff line number Diff line change
@@ -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!"
4 changes: 2 additions & 2 deletions docs/jstorm-doc/quickstart/Compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,4 +25,4 @@ Build install tar

```
mvn package assembly:assembly
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void checkNoContainerHbTimes() {
}
}

public void handlReadDir() {
public void handleReadDir() {
if (StringUtils.isBlank(readDir) == true) {
return;
}
Expand Down Expand Up @@ -180,7 +180,7 @@ public void run() {

handleWriteDir();

handlReadDir();
handleReadDir();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 397f6cf

Please sign in to comment.