diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..651e129
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,57 @@
+---
+Language: Cpp
+# BasedOnStyle: Google
+AccessModifierOffset: -1
+ConstructorInitializerIndentWidth: 4
+AlignEscapedNewlinesLeft: true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
+AllowShortFunctionsOnASingleLine: All
+AlwaysBreakTemplateDeclarations: true
+AlwaysBreakBeforeMultilineStrings: true
+BreakBeforeBinaryOperators: false
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BinPackParameters: true
+ColumnLimit: 80
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+DerivePointerAlignment: true
+ExperimentalAutoDetectBinPacking: false
+IndentCaseLabels: true
+IndentWrappedFunctionNames: false
+IndentFunctionDeclarationAfterType: false
+MaxEmptyLinesToKeep: 1
+KeepEmptyLinesAtTheStartOfBlocks: false
+NamespaceIndentation: None
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakBeforeFirstCallParameter: 1
+PenaltyBreakComment: 300
+PenaltyBreakString: 1000
+PenaltyBreakFirstLessLess: 120
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+SpacesBeforeTrailingComments: 2
+Cpp11BracedListStyle: true
+Standard: Auto
+IndentWidth: 2
+TabWidth: 8
+UseTab: Never
+BreakBeforeBraces: Attach
+SpacesInParentheses: false
+SpacesInAngles: false
+SpaceInEmptyParentheses: false
+SpacesInCStyleCastParentheses: false
+SpacesInContainerLiterals: true
+SpaceBeforeAssignmentOperators: true
+ContinuationIndentWidth: 4
+CommentPragmas: '^ IWYU pragma:'
+ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+SpaceBeforeParens: ControlStatements
+DisableFormat: false
+...
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index bd6a9f8..b38acf2 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,7 +1,18 @@
This PR Fixes DICL/EclipseMETA#(Which issue?)
-Checklist
-- [ ] Follows Google Coding Style.
-- [ ] At least one reviewer approved (for non-trivial changes).
+## BRIEF
+
+## STATUS
+- [ ] Its implemented.
+- [ ] It compiles.
+- [ ] Its tested.
+- [ ] Its refactored.
---
+Make sure that you squeeze all your commits before merging to master.
+You might want to use the following command:
+
+ $ git rebase -i #hash key of base commit
+
+---
+## EXTRA
diff --git a/.travis.yml b/.travis.yml
index af15687..0eec613 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
-sudo: false
-dist: precise
+sudo: false
+dist: precise
language: cpp
cache:
@@ -35,5 +35,5 @@ script:
- cd build
- sh ../configure --prefix=`pwd`
- make -j4
- - make install
- - make -j4 check
+ - make install
+ - make -j4 check
diff --git a/Makefile.am b/Makefile.am
index d2e4e97..22667f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,9 @@
include tests/Makefile.am
-AM_CPPFLAGS = -I@srcdir@/src/common -I@srcdir@/src -include ./config.h $(BOOST_CPPFLAGS)
+AM_CPPFLAGS = $(CPPFLAGS) -I@srcdir@/src/common -I@srcdir@/src -include ./config.h $(BOOST_CPPFLAGS)
AM_CXXFLAGS = $(CXXFLAGS) -Wall
-bin_PROGRAMS = eclipse_node dfs __velox_mapreduce
+bin_PROGRAMS = eclipse_node veloxdfs __velox_mapreduce
bin_SCRIPTS = src/client/veloxmr src/client/veloxmr_lib.py
messages_files = src/messages/boundaries.cc \
@@ -18,7 +18,6 @@ messages_files = src/messages/boundaries.cc \
src/messages/fileupdate.cc \
src/messages/blockinfo.cc \
src/messages/blockupdate.cc \
- src/messages/task.cc \
src/messages/reply.cc \
src/messages/filerequest.cc \
src/messages/blockrequest.cc \
@@ -30,6 +29,11 @@ messages_files = src/messages/boundaries.cc \
src/messages/formatrequest.cc \
src/messages/fileexist.cc \
src/messages/metadata.cc \
+ src/messages/blockstatus.cc \
+ src/messages/IOoperation.cc
+
+mr_messages_files= src/mapreduce/messages/task.cc \
+ src/mapreduce/messages/boost_impl.cc \
src/mapreduce/messages/idatainsert.cc \
src/mapreduce/messages/igroupinsert.cc \
src/mapreduce/messages/iblockinsert.cc \
@@ -42,30 +46,32 @@ messages_files = src/messages/boundaries.cc \
src/mapreduce/messages/iblockinfo.cc \
src/mapreduce/messages/key_value_shuffle.cc \
src/mapreduce/messages/finish_shuffle.cc \
- src/messages/taskstatus.cc \
- src/messages/job.cc \
- src/messages/jobstatus.cc \
- src/messages/subjob.cc \
- src/messages/subjobstatus.cc \
- src/messages/idatakeys.cc \
- src/messages/finishmap.cc \
- src/messages/nodes_shuffling.cc
+ src/mapreduce/messages/taskstatus.cc \
+ src/mapreduce/messages/job.cc \
+ src/mapreduce/messages/jobstatus.cc \
+ src/mapreduce/messages/idatakeys.cc \
+ src/mapreduce/messages/finishmap.cc \
+ src/mapreduce/messages/nodes_shuffling.cc
# libs -----
-lib_LTLIBRARIES = libvdfs.la
+lib_LTLIBRARIES = libvdfs.la libvmr.la
libvdfs_la_SOURCES = $(messages_files) \
src/client/dfs.cc \
src/client/vdfs.cc \
src/common/hash.cc src/common/settings.cc \
src/common/logger.cc src/common/histogram.cc \
src/common/context.cc src/common/dl_loader.cc \
- src/common/context_singleton.cc \
- src/client/vmr.cc \
- src/mapreduce/output_collection.cc
+ src/common/context_singleton.cc
libvdfs_la_LDFLAGS = $(BOOST_LDFLAGS) -version-info 0:0:0
libvdfs_la_LIBADD = -lboost_system -lboost_serialization -lboost_coroutine -lboost_thread -lboost_context -ldl
+libvmr_la_LDFLAGS = $(BOOST_LDFLAGS) -version-info 0:0:0
+libvmr_la_LIBADD = -lboost_system -lboost_serialization -lboost_coroutine -lboost_thread -lboost_context -ldl
+libvmr_la_SOURCES = $(mr_messages_files) \
+ src/client/vmr.cc \
+ src/mapreduce/output_collection.cc
+
# Binaries ----
if BOOST_STATIC
AM_LDFLAGS = -static $(BOOST_LDFLAGS) -Wl,--start-group -Wl,-Bstatic,-lboost_system,-lboost_serialization,-lboost_coroutine,-lboost_thread,-lboost_context,-Bdynamic
@@ -76,37 +82,46 @@ LDADD = libvdfs.la -lboost_system -lboost_serialization -lboost_co
endif
eclipse_node_SOURCES = src/targets/node_main_mr.cc \
- src/network/channel.cc \
src/network/asyncchannel.cc \
- src/network/p2p.cc \
src/network/server.cc \
- src/network/acceptor.cc \
- src/network/connector.cc \
+ src/network/client_handler.cc \
+ src/network/server_handler.cc \
+ src/network/simple_router.cc \
+ src/network/router_decorator.cc \
src/nodes/machine.cc \
- src/nodes/peerdfs.cc \
- src/nodes/local_io.cc \
- src/nodes/remotedfs.cc \
- src/nodes/router.cc \
- src/nodes/directory.cc \
src/nodes/node.cc \
- src/mapreduce/nodes/peermr.cc \
- src/mapreduce/nodes/remotemr.cc \
+ src/blocknode/local_io.cc \
+ src/blocknode/block_node.cc \
+ src/blocknode/block_node_router.cc \
+ src/fileleader/directory.cc \
+ src/fileleader/file_leader.cc \
+ src/fileleader/file_leader_router.cc \
+ src/mapreduce/task_executor.cc \
+ src/mapreduce/task_executor_router.cc \
src/mapreduce/fs/directorymr.cc \
src/mapreduce/fs/iwriter.cc \
src/mapreduce/fs/ireader.cc \
src/mapreduce/executor.cc \
- src/mapreduce/py_executor.cc
+ src/mapreduce/task_handler.cc \
+ src/mapreduce/task_cxx.cc \
+ src/mapreduce/task_python.cc
-eclipse_node_LDADD = $(LDADD) -lpython2.7
-__velox_mapreduce_SOURCES = src/targets/veloxmr_mapreduce.cc
+eclipse_node_LDADD = libvmr.la $(LDADD) -lpython2.7
-dfs_SOURCES = src/client/client.cc
+veloxdfs_SOURCES = src/targets/client.cc \
+ src/client/cli_driver.cc
+
+__velox_mapreduce_SOURCES = src/targets/veloxmr_mapreduce.cc
+__velox_mapreduce_LDADD = libvmr.la $(LDADD) libvdfs.la
pkginclude_HEADERS = src/client/vdfs.hh \
src/client/dfs.hh \
src/client/vmr.hh \
src/mapreduce/output_collection.hh
+modelincludedir = $(pkgincludedir)/model
+modelinclude_HEADERS = src/client/model/metadata.hh
+
if COPY_SAMPLES
sysconf_DATA = doc/eclipse.json
endif
diff --git a/README.md b/README.md
index 6d940b4..bef36e4 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,9 @@
[](https://travis-ci.org/DICL/VeloxMR)
[](https://dicl.slack.com/messages/general/)
-
+[](https://zenhub.com)
[](https://github.com/DICL/VeloxMR)
-BRIEFING
+---
+VeloxMR {#mainpage}
========
VeloxMR is a MapReduce framework implemented in C++ on the top of VeloxDF
@@ -16,17 +17,19 @@ USAGE
=====
VeloxMR default launcher is not included in this repository, if you want to use it you can find it [here][eclipsed].
-The reason to not to include the launcher inside the package is to let the user to chose any launcher, options are:
+The reason not to include the launcher inside the package is to let the user to choose any launcher or service managers such as:
- systemd/init.d
- puppet/chef/salt
-Once the system is running, you can interact with EclipseDFS with the following commands:
+Once the system is up and running, you can interact with VeloxDFS with the following commands:
```
- $ dfs ls|put|get|rm|format|show
+ $ dfs put|get|cat|ls|rm|format|pget|update|append
```
COMPILING & INSTALLING
-=====================
+======================
+
+_Detailed information can be found in the wiki of this repository_
Compiling requirements
----------------------
@@ -41,11 +44,11 @@ For single user installation for developers
$ mkdir -p local_eclipse/{tmp,sandbox} # Create a sandbox directories
$ cd local_eclipse # enter in the directory
- $ git clone git@github.com:DICL/EclipseDFS.git # Clone the project from github
- $ cd EclipseDFS
+ $ git clone git@github.com:DICL/VeloxDFS.git # Clone the project from github
+ $ cd VeloxDFS
$ sh autogen.sh # Generate configure script
$ cd ../tmp # Go to building folder
- $ sh ../EclipseDFS/configure --prefix=`pwd`/../sandbox # Check requirements and generate the Makefile
+ $ sh ../VeloxDFS/configure --prefix=`pwd`/../sandbox # Check requirements and generate the Makefile
# If you get a boost error go the FAQ section of the README
@@ -57,11 +60,28 @@ Now edit in your **~/.bashrc** or **~/.profile**:
export PATH="/home/*..PATH/To/eclipse/..*/sandbox/bin":$PATH
export LIBRARY_PATH="/home/*..PATH/To/eclipse/..*/sandbox/lib"
export C_INCLUDE_PATH="/home/*..PATH/To/eclipse/..*/sandbox/include"
- export MANPATH=`manpath`:/home*..PATH/To/eclipse/..*/sandbox/share/man
-For the configuration refer to the manpage:
- $ man eclipsefs
+Default settings for VELOXDFS
+-----------------------------
+
+ "log" : {
+ "type" : "LOG_LOCAL6"
+ "name" : "ECLIPSE"
+ "mask" : "DEBUG"
+ },
+
+ "cache" : {
+ "numbin" : 100,
+ "size" : 200000,
+ "concurrency" : 1
+ },
+
+ "filesystem" : {
+ "block" : 137438953,
+ "buffer" : 512,
+ "replica" : 1
+ }
FAQ
---
@@ -70,27 +90,18 @@ FAQ
- _Answer_ : It probably means that you do not have boost library installed in
the default location, in such case you should specify the boost library location.
```
- sh ../EclipseDFS/configure --prefix ~/sandbox --with-boost=/usr/local --with-boost-libdir=/usr/local/lib
+ sh ../VeloxDFS/configure --prefix ~/sandbox --with-boost=/usr/local --with-boost-libdir=/usr/local/lib
```
In this example we assume that the boost headers are in `/usr/local/include` while the library files
are inside `/usr/local/lib`.
-AUTHOR
-======
-
- - __AUTHOR:__ [Vicente Adolfo Bolea Sanchez] [vicente]
- - __AUTHOR:__ [MooHyeon Nam] [mh]
- - __AUTHOR:__ [WonBae Kim] [wb]
- - __AUTHOR:__ [KiBeom Jin] [kb]
- - __AUTHOR:__ [Prof. Nam Beomseok] [nb]
- - __INSTITUTION:__ [DICL laboratory] [dicl] at [UNIST]
-
-
-[vicente]: https://github.com/vicentebolea
-[ym]: https://github.com/youngmoon01
-[dicl]: http://dicl.unist.ac.kr
-[mh]: https://github.com/nammh
-[wb]: https://github.com/zwigul
-[kb]: https://github.com/kbjin
-[eclipsed]: https://github.com/DICL/eclipsed
-[nb]: http://dicl.unist.ac.kr
+AUTHORS
+=======
+
+ - __AUTHOR:__ [Vicente Adolfo Bolea Sanchez](http://vicentebolea.me)
+ - __AUTHOR:__ [MooHyeon Nam](https://github.com/nammh)
+ - __AUTHOR:__ [WonBae Kim](https://github.com/zwigul)
+ - __AUTHOR:__ [KiBeom Jin](https://github.com/kbjin)
+ - __AUTHOR:__ [Deukyeon Hwang](https://github.com/deukyeon)
+ - __AUTHOR:__ [Prof. Nam Beomseok](http://dicl.unist.ac.kr)
+ - __INSTITUTION:__ [DICL laboratory](http://dicl.unist.ac.kr) at _UNIST_
diff --git a/configure.ac b/configure.ac
index f00abe4..9f45bf5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,11 +7,8 @@ AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_SILENT_RULES([yes])
LT_INIT([dlopen])
-#AC_CONFIG_MACRO_DIR([./m4/])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile ])
-AC_CONFIG_FILES([tests/nodes_executor], [chmod +x tests/nodes_executor])
-AC_CONFIG_FILES([tests/eclipse_debug], [chmod +x tests/eclipse_debug])
AC_CONFIG_FILES([src/client/veloxmr], [chmod +x src/client/veloxmr])
AM_CONDITIONAL([DEFAULT_CXXFLAGS], [test -z "$CXXFLAGS"])
diff --git a/data/kmeans.input b/data/kmeans.input
deleted file mode 100644
index dafa99b..0000000
--- a/data/kmeans.input
+++ /dev/null
@@ -1,1000 +0,0 @@
-55.69-19.73
-60.03-68.02
-61.68-72.47
-80.35-11.54
-25.94-68.35
-78.83-5.62
-21.05-97.78
-77.69-70.89
-56.69-77.61
-61.39-5.05
-73.23-73.51
-82.8-46.1
-89.34-3.38
-83.12-72.01
-53.48-85.41
-55.56-82.78
-34.24-77.72
-21.21-29.1
-33.69-91.7
-35.56-23.93
-68.96-43.77
-83.96-9.19
-84.91-50.65
-12.53-21.59
-58.99-38.17
-14.44-12.6
-1.98-93.02
-0.49-37.08
-85.29-0.99
-68.49-40.37
-95.8-41.25
-60.77-61.68
-21.34-30.55
-29.86-60.9
-47.0-56.73
-36.38-44.35
-28.95-74.29
-86.79-98.99
-32.03-68.61
-67.72-92.02
-12.16-20.88
-8.23-91.03
-75.52-35.31
-28.13-66.84
-25.54-61.68
-26.07-66.95
-10.77-99.63
-23.87-10.57
-25.0-25.73
-1.58-79.13
-68.62-91.85
-16.03-21.26
-60.86-96.36
-22.2-43.31
-25.2-60.69
-28.13-26.18
-53.9-53.36
-28.18-67.34
-45.85-60.35
-38.68-42.23
-31.47-94.18
-16.21-77.22
-57.58-26.66
-3.1-77.37
-34.75-96.18
-59.15-10.77
-0.88-10.49
-56.25-19.78
-53.59-5.43
-44.47-90.12
-29.57-5.77
-58.57-93.19
-38.4-51.09
-46.25-67.74
-73.63-61.72
-43.66-56.42
-62.48-55.37
-10.47-57.27
-53.68-24.58
-83.92-27.1
-55.71-99.51
-91.12-1.29
-41.0-43.16
-52.79-90.68
-9.58-15.9
-53.13-67.38
-56.02-15.3
-77.08-98.53
-7.38-56.98
-22.39-83.29
-24.54-0.29
-29.77-45.55
-18.82-41.47
-91.65-50.23
-94.59-50.82
-72.83-46.5
-38.28-9.42
-51.34-20.47
-91.41-32.54
-85.39-13.46
-66.77-0.4
-67.23-41.39
-28.55-3.22
-81.2-80.39
-82.39-78.95
-24.66-42.9
-11.72-69.98
-46.2-50.62
-53.63-74.84
-68.34-63.38
-96.53-21.17
-54.64-72.95
-44.67-64.59
-67.6-36.08
-13.8-25.77
-27.46-94.57
-4.75-70.72
-7.93-26.01
-83.63-11.9
-58.31-50.07
-35.08-46.67
-6.2-35.13
-43.02-95.74
-9.88-26.99
-47.66-17.51
-25.94-72.05
-57.78-67.85
-1.64-87.62
-74.97-48.88
-81.92-54.18
-33.01-81.83
-32.24-1.66
-1.83-61.28
-47.05-95.65
-81.28-74.34
-96.67-91.35
-91.03-9.68
-47.01-67.27
-60.67-79.9
-25.07-31.16
-16.19-48.43
-33.48-67.28
-47.0-29.19
-34.79-60.95
-56.34-56.47
-84.07-2.49
-67.43-91.42
-21.29-11.18
-29.2-80.38
-53.14-19.65
-82.48-81.77
-24.79-83.05
-7.96-82.36
-73.83-90.97
-26.55-41.9
-6.73-50.97
-23.86-57.21
-84.92-10.16
-30.94-55.19
-88.78-55.56
-75.67-8.48
-23.1-34.74
-21.0-7.99
-30.04-84.36
-13.61-80.52
-80.9-70.77
-64.23-86.62
-78.13-43.22
-92.74-95.45
-98.15-12.63
-37.05-8.44
-86.12-62.59
-85.58-47.02
-3.95-69.21
-5.97-12.56
-31.57-74.18
-66.0-82.43
-18.22-30.54
-48.88-89.46
-58.5-4.05
-47.06-53.23
-83.79-27.36
-76.86-12.47
-54.26-48.22
-3.87-51.59
-91.54-2.78
-34.57-40.21
-63.6-67.65
-46.2-63.53
-78.48-46.36
-43.3-30.65
-52.35-60.19
-95.26-70.55
-99.57-80.53
-78.66-65.41
-52.27-37.51
-37.69-19.19
-16.63-19.06
-32.26-22.36
-6.29-21.74
-51.67-39.77
-61.42-57.07
-6.13-8.0
-92.68-53.29
-99.72-74.95
-41.07-12.51
-45.53-87.26
-58.84-84.03
-49.48-87.04
-53.48-1.97
-77.83-32.32
-4.16-93.4
-71.59-15.22
-27.33-92.0
-56.31-64.62
-81.26-58.22
-26.23-29.12
-18.98-39.19
-24.25-51.06
-83.27-40.56
-31.62-91.16
-30.13-61.82
-10.86-67.53
-5.02-53.84
-69.5-95.87
-68.03-51.87
-29.8-16.01
-96.54-34.02
-98.46-60.48
-8.74-50.72
-54.7-63.03
-20.0-19.08
-83.72-7.39
-13.19-44.84
-14.93-41.45
-45.45-45.26
-89.79-5.54
-43.05-94.17
-39.99-12.07
-27.36-80.87
-60.39-28.78
-6.56-9.94
-87.34-7.36
-80.98-90.57
-72.41-51.06
-47.6-12.54
-93.97-69.98
-16.16-22.67
-53.91-87.78
-62.3-97.73
-91.29-16.86
-83.02-74.83
-32.28-48.33
-88.15-86.89
-70.27-94.26
-39.73-81.35
-98.47-61.52
-36.39-92.82
-58.26-49.62
-95.66-89.84
-18.02-8.44
-71.47-71.03
-7.37-28.06
-73.67-10.43
-63.32-13.34
-36.57-27.31
-81.2-27.27
-52.65-51.75
-9.03-53.81
-9.21-4.47
-23.87-45.2
-54.05-59.6
-71.79-6.7
-78.73-0.63
-95.68-31.08
-26.82-67.95
-13.19-87.53
-13.92-27.98
-30.03-68.96
-60.76-39.94
-96.15-65.93
-53.66-71.39
-93.84-11.32
-5.89-95.62
-64.07-7.51
-8.72-66.2
-96.48-30.32
-37.01-13.0
-69.42-76.53
-91.93-96.58
-4.63-69.87
-2.53-86.18
-45.92-27.09
-62.75-54.35
-45.65-27.77
-93.05-59.29
-41.98-38.95
-22.14-87.83
-12.57-87.05
-6.64-89.59
-3.05-12.57
-28.8-23.73
-25.15-48.38
-24.64-74.51
-62.28-63.92
-66.16-20.81
-69.29-21.39
-44.07-63.8
-74.64-2.73
-20.04-72.42
-93.38-30.54
-41.64-43.57
-35.53-58.83
-10.89-1.52
-30.38-5.75
-82.22-46.8
-82.97-50.48
-34.17-63.77
-30.84-29.66
-81.21-24.23
-10.67-55.46
-54.65-34.76
-36.38-51.93
-13.12-45.21
-19.51-25.72
-42.78-87.76
-63.46-52.53
-29.71-2.85
-77.22-86.05
-80.17-25.35
-94.25-58.93
-45.85-71.03
-51.82-63.33
-52.91-80.13
-59.0-21.75
-75.75-26.89
-92.5-34.74
-24.47-98.57
-88.4-49.92
-26.03-44.53
-94.65-26.98
-67.27-56.71
-21.62-47.97
-26.69-90.1
-99.43-86.1
-81.43-14.29
-2.8-39.8
-26.98-61.14
-92.84-72.97
-8.39-72.76
-47.74-11.34
-99.84-75.14
-1.23-71.92
-45.41-14.48
-50.19-25.64
-49.28-64.76
-77.78-69.7
-13.1-84.91
-78.2-8.15
-97.61-25.38
-65.4-71.48
-70.54-25.15
-52.45-51.85
-0.71-9.33
-73.33-29.51
-25.22-49.44
-96.74-23.71
-8.44-12.86
-16.26-55.34
-77.28-16.92
-45.08-64.97
-5.62-56.7
-40.09-58.76
-57.6-51.16
-19.23-44.72
-25.29-73.94
-34.6-31.15
-66.35-76.88
-64.13-19.81
-2.72-48.1
-33.31-78.96
-37.19-83.78
-20.37-73.44
-58.34-59.13
-6.52-73.56
-62.98-12.54
-77.05-77.65
-58.1-91.98
-53.04-82.28
-26.15-7.57
-40.19-96.74
-73.37-66.13
-97.18-19.68
-71.57-91.14
-54.49-65.58
-32.31-70.15
-91.32-40.01
-44.31-34.2
-44.88-51.26
-28.52-85.02
-7.98-18.74
-61.42-56.45
-11.95-15.53
-6.67-75.33
-10.36-95.43
-43.09-34.77
-95.16-3.92
-51.43-12.82
-12.58-21.55
-83.23-4.07
-10.96-52.57
-38.48-97.81
-99.88-23.64
-16.94-59.32
-68.01-87.39
-28.93-5.5
-22.65-5.43
-29.06-60.3
-67.91-5.81
-74.64-12.65
-41.59-81.5
-54.62-92.06
-80.41-44.58
-31.59-98.08
-72.2-92.59
-99.04-82.89
-34.78-5.82
-56.82-18.92
-34.87-11.06
-42.22-94.98
-60.65-21.07
-49.54-93.25
-66.99-35.02
-96.03-3.45
-79.41-69.51
-51.58-60.15
-87.29-50.95
-5.84-57.42
-89.23-79.26
-50.33-11.23
-86.18-29.51
-0.71-48.08
-89.83-35.77
-72.1-78.08
-47.67-85.12
-95.52-35.54
-97.66-64.96
-57.19-87.12
-83.86-11.4
-38.97-28.2
-88.48-48.05
-55.8-37.2
-67.81-33.7
-92.62-35.03
-83.63-3.32
-37.29-33.23
-50.57-24.12
-90.94-35.15
-55.71-56.76
-98.41-87.95
-30.36-92.88
-61.17-47.36
-42.35-77.4
-72.22-72.49
-52.44-46.18
-69.29-63.94
-68.84-16.83
-5.2-44.3
-28.15-58.33
-35.0-52.62
-9.23-63.41
-19.06-62.66
-8.98-46.24
-80.92-86.72
-86.69-35.35
-65.91-54.76
-83.08-67.59
-12.97-88.8
-78.11-49.21
-53.18-56.22
-85.89-90.65
-57.64-33.32
-43.03-88.8
-72.89-42.31
-96.19-92.21
-29.99-91.49
-22.85-54.61
-42.86-93.63
-98.26-23.52
-17.89-31.34
-93.98-92.37
-8.83-78.19
-76.01-38.23
-24.68-91.93
-87.46-98.43
-88.59-89.32
-81.54-3.46
-34.36-44.63
-37.01-21.91
-43.05-91.16
-11.29-23.41
-3.92-31.22
-28.6-83.27
-64.51-39.54
-88.22-33.44
-88.62-1.88
-97.04-0.48
-82.09-20.68
-24.43-45.12
-83.56-98.54
-11.53-95.16
-72.29-75.17
-38.35-93.78
-3.63-79.33
-82.53-35.56
-65.58-58.38
-30.96-31.89
-67.53-41.89
-1.52-43.82
-50.62-91.15
-25.09-92.28
-94.11-36.44
-15.76-99.23
-62.01-35.05
-26.93-52.75
-11.51-18.0
-23.71-26.81
-17.3-26.49
-39.08-41.44
-33.62-48.11
-77.24-89.25
-6.45-38.92
-85.83-1.87
-28.22-18.81
-30.39-89.55
-37.54-46.18
-72.32-71.09
-95.47-46.4
-82.72-76.17
-35.18-58.17
-35.31-68.65
-37.64-55.29
-23.71-54.56
-30.62-67.35
-59.3-46.95
-63.18-90.61
-76.91-89.02
-92.5-51.24
-48.0-54.64
-15.63-67.39
-90.57-43.81
-37.83-83.01
-63.66-17.88
-58.51-43.69
-29.16-74.36
-98.54-87.15
-96.6-87.26
-54.25-38.64
-11.65-0.43
-48.26-43.78
-6.76-44.89
-35.42-79.81
-68.8-15.09
-84.74-72.37
-1.12-93.23
-35.33-86.62
-15.09-24.23
-25.52-54.96
-97.63-23.68
-17.96-11.92
-45.36-80.73
-76.74-81.69
-92.76-83.95
-51.36-65.16
-95.49-61.3
-92.78-11.81
-73.02-59.49
-26.33-13.36
-1.21-55.46
-72.4-54.02
-5.31-93.8
-9.75-16.51
-37.45-23.43
-67.87-57.8
-19.67-93.9
-32.04-20.63
-21.75-98.69
-44.49-28.05
-37.16-1.11
-72.48-9.87
-92.31-38.07
-26.19-28.89
-57.75-83.09
-43.81-64.72
-91.59-58.73
-92.94-65.24
-93.71-39.32
-74.29-58.5
-55.1-73.01
-51.85-1.5
-69.51-23.7
-26.64-21.22
-24.92-30.78
-44.32-75.45
-19.73-77.12
-54.1-92.33
-68.48-10.78
-68.39-37.75
-68.79-82.5
-31.97-21.96
-87.76-94.24
-39.07-86.69
-95.93-30.4
-75.26-29.22
-39.36-66.15
-77.84-84.5
-60.31-26.64
-17.72-43.21
-38.87-83.21
-77.8-46.21
-61.21-98.98
-4.76-7.45
-82.48-62.23
-17.86-89.73
-92.4-39.5
-88.25-16.79
-3.83-50.46
-67.1-57.97
-97.37-70.42
-39.52-86.2
-55.84-21.46
-0.27-29.52
-79.52-52.17
-94.49-60.21
-86.91-84.22
-18.75-81.92
-57.62-34.47
-87.41-37.53
-93.49-0.25
-26.78-45.66
-97.16-0.27
-96.63-71.95
-39.66-32.35
-71.9-46.77
-93.0-8.84
-75.01-58.46
-10.22-99.49
-71.31-16.53
-31.99-40.04
-51.19-15.95
-88.04-99.98
-3.82-72.53
-24.74-44.89
-52.89-99.2
-56.19-37.74
-20.48-70.19
-16.56-74.66
-7.88-29.6
-84.66-37.13
-30.15-74.92
-22.63-38.42
-44.28-94.1
-16.67-72.36
-21.87-79.84
-86.24-40.59
-53.68-56.44
-58.98-39.28
-82.61-63.77
-44.8-9.04
-33.42-59.24
-89.58-30.76
-30.06-93.31
-68.05-24.26
-87.42-59.72
-94.1-57.33
-83.59-25.29
-6.24-93.9
-48.52-87.63
-1.38-34.99
-0.01-4.09
-94.07-13.85
-41.41-20.29
-92.01-50.64
-69.61-41.46
-91.51-95.89
-27.37-37.26
-7.13-77.23
-99.91-87.79
-44.95-6.65
-78.46-64.02
-59.76-19.68
-87.49-48.89
-51.83-74.51
-6.38-81.62
-88.7-52.17
-60.12-57.98
-71.43-51.05
-26.96-12.31
-100.0-66.53
-91.77-33.26
-79.76-67.9
-24.74-64.79
-42.86-60.59
-39.94-54.5
-54.14-18.12
-36.0-46.75
-93.09-56.05
-0.92-86.63
-91.54-60.78
-89.72-79.23
-44.79-49.18
-95.86-79.71
-60.54-34.16
-58.15-52.54
-42.18-98.49
-13.82-74.19
-65.31-23.1
-89.76-58.57
-24.35-19.51
-10.11-8.55
-44.85-8.03
-39.86-58.89
-25.58-31.41
-51.69-65.52
-80.91-69.96
-65.38-8.46
-49.15-96.46
-21.38-46.82
-34.7-25.8
-64.62-7.09
-88.72-4.11
-68.52-13.02
-31.27-33.99
-57.61-31.57
-84.76-75.65
-13.51-16.43
-60.0-23.35
-18.88-66.67
-98.89-61.4
-27.14-45.74
-59.59-80.75
-78.49-61.74
-3.57-82.5
-18.35-90.46
-41.31-83.95
-57.58-36.94
-72.89-96.65
-82.51-20.47
-58.52-52.31
-1.93-18.59
-1.9-86.77
-60.46-35.97
-45.52-43.73
-94.03-99.57
-43.03-79.32
-16.85-19.86
-74.3-60.26
-72.81-19.12
-4.99-39.41
-16.01-53.42
-90.7-22.22
-14.51-70.05
-73.84-21.07
-36.46-83.42
-75.7-52.83
-47.56-57.73
-1.04-47.44
-43.11-21.96
-6.5-96.89
-77.98-73.31
-20.01-90.97
-27.35-23.71
-20.33-63.8
-14.47-87.91
-43.38-30.46
-13.95-84.72
-20.0-40.11
-69.31-45.18
-10.07-53.19
-54.27-33.34
-15.77-59.53
-62.88-52.58
-76.93-58.47
-30.52-78.81
-20.1-51.86
-88.87-35.14
-73.92-62.96
-61.04-58.32
-84.98-58.02
-20.42-29.64
-39.55-14.8
-68.28-19.58
-97.23-79.62
-46.29-57.63
-12.43-11.02
-18.59-70.17
-94.32-58.63
-82.77-69.46
-9.68-46.8
-39.87-54.58
-73.37-68.55
-88.87-13.34
-17.64-63.83
-45.92-25.25
-45.64-84.88
-62.04-34.9
-93.79-35.53
-78.9-76.74
-82.13-93.71
-26.21-42.4
-41.41-52.91
-99.44-71.7
-32.32-25.34
-71.25-1.15
-16.83-70.73
-38.05-75.14
-48.93-68.08
-52.47-96.67
-70.36-8.87
-58.66-77.62
-70.21-38.38
-19.7-17.56
-0.73-33.87
-32.74-92.84
-13.98-88.24
-96.77-19.2
-39.73-24.26
-20.4-90.91
-89.44-1.29
-77.85-96.69
-40.41-49.5
-41.25-7.58
-72.89-61.08
-42.17-76.08
-34.37-55.35
-68.57-3.98
-53.5-51.06
-69.68-33.38
-63.31-83.99
-92.28-4.05
-40.89-97.32
-98.86-91.4
-34.11-92.9
-40.41-4.47
-7.99-90.22
-62.48-0.12
-14.99-0.64
-96.41-24.71
-39.82-31.99
-61.67-29.58
-4.21-65.56
-86.49-28.77
-88.71-0.06
-89.58-76.09
-65.05-62.63
-18.21-75.76
-16.73-87.36
-28.39-80.46
-94.12-35.99
-6.14-60.03
-77.75-63.74
-51.25-76.62
-51.76-25.65
-88.4-18.06
-6.36-1.6
-21.04-20.22
-89.89-16.93
-59.17-10.53
-99.04-49.52
-25.17-93.75
-67.35-35.1
-55.85-51.26
-69.18-21.84
-87.82-8.42
-83.46-80.31
-25.45-38.57
-61.68-52.2
-58.53-35.61
-46.23-66.82
-71.12-54.66
-24.28-97.66
-3.41-52.82
-26.45-72.61
-0.96-73.29
-60.91-63.49
-18.57-14.54
-15.36-22.29
-59.19-79.62
-39.89-81.13
-35.35-1.56
-39.57-85.85
-34.99-5.78
-58.89-33.21
-91.14-94.32
-19.48-62.29
-19.46-80.08
-43.2-49.18
-65.05-69.5
-37.32-29.29
-51.67-92.07
-45.23-52.85
-91.0-13.83
-82.27-27.41
-28.84-62.33
-43.01-5.84
-70.88-84.23
-50.59-49.19
-21.32-59.53
-10.74-34.73
-44.69-55.72
-10.1-3.41
-82.79-23.9
-29.26-86.16
-35.3-61.19
-40.05-75.88
-29.58-88.54
-73.57-76.2
-54.98-50.45
-53.37-17.33
-26.99-32.0
-33.99-42.91
-90.76-29.35
-81.19-48.88
-67.54-14.7
-10.9-57.04
-25.2-22.35
-6.41-79.15
-67.01-57.97
-48.21-58.96
-66.74-91.48
-49.19-49.78
-70.66-74.27
-39.22-67.67
-26.02-60.99
-70.94-97.96
-35.9-57.09
-13.58-69.41
-32.19-94.94
-99.79-94.64
-8.9-53.94
-57.95-21.7
-64.07-72.75
-10.13-86.57
-41.89-95.94
-28.79-35.06
-7.45-6.4
-2.83-4.75
-92.95-99.19
-63.92-47.82
-77.41-89.58
-69.53-34.04
-25.51-28.36
-2.12-50.47
-4.67-22.16
-47.38-36.5
-41.99-61.07
-5.65-0.13
-41.81-32.52
-38.4-83.39
-82.65-58.53
-32.99-63.05
-89.55-38.04
-34.79-26.22
-90.83-56.76
-17.52-46.09
-56.84-11.88
-20.55-0.15
-19.47-81.68
-68.06-87.09
-73.6-49.1
-86.04-35.54
-88.52-17.22
-52.41-74.96
-58.74-5.47
-51.84-52.01
-13.84-72.09
-17.35-87.4
-81.08-78.37
-99.15-96.61
-79.7-32.0
-43.82-37.89
-70.86-6.6
-16.47-10.34
-18.07-16.99
-20.21-44.44
-70.94-0.2
-81.26-54.9
-9.77-52.15
-93.72-0.97
-95.47-38.08
-10.0-49.57
-7.5-17.81
-74.55-73.51
-61.95-76.37
-16.22-59.44
-73.32-49.54
-95.28-52.53
-12.19-46.13
-41.6-11.41
-40.81-86.18
diff --git a/data/point_generator.ruby b/data/point_generator.ruby
deleted file mode 100644
index ac4971c..0000000
--- a/data/point_generator.ruby
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/ruby
-
-i = 0
-
-while (i < ARGV[0].to_i) do
- puts "#{Random.rand(0.0...100.0).round(2)},#{Random.rand(0.00...100.00).round(2)}"
-
- i += 1
-end
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 8524d96..4481a4d 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -33,7 +33,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
-PROJECT_NAME = "EclipseDFS"
+PROJECT_NAME = "VeloxDFS"
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@@ -45,7 +45,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.
-PROJECT_BRIEF = "Distributed FS"
+PROJECT_BRIEF = "Distributed file system for Big Data processing"
# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
# the documentation. The maximum height of the logo should not exceed 55 pixels
@@ -178,7 +178,7 @@ SHORT_NAMES = NO
# description.)
# The default value is: NO.
-JAVADOC_AUTOBRIEF = NO
+JAVADOC_AUTOBRIEF = YES
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
@@ -217,7 +217,7 @@ SEPARATE_MEMBER_PAGES = NO
# uses this value to replace tabs by spaces in code fragments.
# Minimum value: 1, maximum value: 16, default value: 4.
-TAB_SIZE = 4
+TAB_SIZE = 2
# This tag can be used to specify a number of aliases that act as commands in
# the documentation. An alias has the form:
@@ -755,6 +755,8 @@ WARN_LOGFILE =
# Note: If this tag is empty the current directory is searched.
INPUT = ../src
+INPUT += ../README.md
+USE_MDFILE_AS_MAINPAGE = ../README.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/java_compile.sh b/java_compile.sh
new file mode 100644
index 0000000..9382117
--- /dev/null
+++ b/java_compile.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+JNI_CLASSES=( VeloxDFS VDFS )
+
+JAVA_SOURCE_PATH=./src/java/velox
+JAVA_BUILD_PATH=./build/java
+
+if [ ! -d "$JAVA_BUILD_PATH" ]; then
+ mkdir $JAVA_BUILD_PATH
+fi
+
+LIB_PATH=./build/lib
+
+JNI_PATH=$JAVA_SOURCE_PATH/../jni
+JNI_SOURCE_NAMES=( velox_DFS.cc velox_VDFS.cc )
+JNI_OUTPUT_NAMES=( libdfs_jni.so libvdfs_jni.so )
+
+echo "COMPILING JAVA sources in \`$JAVA_BUILD_PATH\`..";
+MODEL_SOURCES=( Metadata.java )
+javac -d $JAVA_BUILD_PATH ${MODEL_SOURCES[@]/#/$JAVA_SOURCE_PATH\/model/};
+
+SOURCES=( ${JNI_CLASSES[@]/%/.java} )
+javac -d $JAVA_BUILD_PATH ${SOURCES[@]/#/$JAVA_SOURCE_PATH/};
+
+echo "CREATING jni header files in \`$JNI_PATH\`..";
+javah -jni -d $JNI_PATH ${JNI_CLASSES[@]/#/velox.};
+
+echo "CREATING jni libraries in \`$LIB_PATH\`..";
+i=0
+for source_file in ${JNI_SOURCE_NAMES[*]}; do
+ echo ${JNI_OUTPUT_NAMES[$i]}
+ g++ --std=c++14 -shared -o $LIB_PATH/${JNI_OUTPUT_NAMES[$i]} -fPIC -L/usr/local/lib -I/opt/java/jdk1.7.0_51/include/linux -I/opt/java/jdk1.7.0_51/include $JNI_PATH/$source_file -lc -lboost_system -lboost_serialization -lboost_coroutine -lboost_thread -lboost_context -lvdfs;
+ let i=i+1
+done
diff --git a/set-env.sh b/set-env.sh
new file mode 100644
index 0000000..e9606a8
--- /dev/null
+++ b/set-env.sh
@@ -0,0 +1,20 @@
+# Path for VeloxDFS
+VELOXHOME=~/VeloxDFS
+cd $VELOXHOME
+
+# Your Install Path
+INSTALL_PATH=`pwd`/build
+
+export PATH="$INSTALL_PATH/bin:$PATH"
+export LIBRARY_PATH="$INSTALL_PATH/lib:/usr/local/lib:$LIBRARY_PATH"
+export LD_LIBRARY_PATH="$INSTALL_PATH/lib:/usr/local/lib:$LD_LIBRARY_PATH"
+export CPATH="$INSTALL_PATH/include:$CPATH"
+export C_INCLUDE_PATH="$INSTALL_PATH/include:$C_INCLUDE_PATH"
+export CPLUS_INCLUDE_PATH="$INSTALL_PATH/include:$CPLUS_INCLUDE_PATH"
+export MANPATH=$MANPATH:"$INSTALL_PATH/share/man"
+export LDFLAGS="-L/usr/local/lib"
+export PYTHONPATH=$INSTALL_PATH/bin
+export CLASSPATH=$INSTALL_PATH/java:$CLASSPATH
+
+# Come back
+cd -
diff --git a/src/blocknode/block_node.cc b/src/blocknode/block_node.cc
new file mode 100644
index 0000000..27571eb
--- /dev/null
+++ b/src/blocknode/block_node.cc
@@ -0,0 +1,97 @@
+// includes & usings {{{
+#include "block_node.hh"
+
+using namespace eclipse;
+using namespace eclipse::messages;
+using namespace eclipse::network;
+using namespace std;
+
+// }}}
+
+namespace eclipse {
+// Constructor & destructor {{{
+BlockNode::BlockNode (ClientHandler* net) : Node () {
+ network = net;
+ network_size = context.settings.get("network.nodes").size();
+}
+
+BlockNode::~BlockNode() { }
+// }}}
+// replicate_message {{{
+//! @brief Compute the right and left node of the current node
+//! and send its replicas of the given block
+void BlockNode::replicate_message(IOoperation* m) {
+ vector nodes;
+ for (int i=1; i < 3; i++) {
+ if(i%2 == 1) {
+ nodes.push_back ((id + (i+1)/2 + network_size) % network_size);
+ } else {
+ nodes.push_back ((id - i/2 + network_size) % network_size);
+ }
+ }
+ network->send_and_replicate(nodes, m);
+}
+// }}}
+// block_insert_local {{{
+//! @brief This method insert the block locally and replicated it.
+bool BlockNode::block_insert_local(Block& block, bool replicate) {
+ local_io.write(block.first, block.second);
+
+ if (replicate) {
+ INFO("[DFS] Saving locally BLOCK: %s", block.first.c_str());
+ IOoperation io;
+ io.operation = messages::IOoperation::OpType::BLOCK_INSERT_REPLICA;
+ io.block = move(block);
+ replicate_message(&io);
+ } else {
+ INFO("[DFS] Saving replica locally BLOCK: %s", block.first.c_str());
+ }
+
+ return true;
+}
+// }}}
+// block_read_local {{{
+//! @brief This method read the block locally.
+bool BlockNode::block_read_local(Block& block, uint64_t off, uint64_t len, bool ignore_params) {
+ INFO("BLOCK REQUEST: %s", block.first.c_str());
+ block.second = local_io.read(block.first, off, len, ignore_params);
+ return true;
+}
+// }}}
+// block_delete_local {{{
+//! @brief This method read the block locally.
+bool BlockNode::block_delete_local(Block& block, bool replicate) {
+ local_io.remove(block.first);
+
+ INFO("[DFS] Removed locally BLOCK: %s", block.first.c_str());
+
+ if (replicate) {
+ IOoperation io;
+ io.operation = messages::IOoperation::OpType::BLOCK_DELETE_REPLICA;
+ io.block = move(block);
+ replicate_message(&io);
+ }
+
+ return true;
+}
+// }}}
+// block_update_local {{{
+bool BlockNode::block_update_local(Block& block, uint32_t pos, uint32_t len, bool replicate) {
+ local_io.update(block.first, block.second, pos, len);
+
+ if (replicate) {
+ INFO("Block %s updated real host", block.first.c_str());
+ IOoperation io;
+ io.operation = messages::IOoperation::OpType::BLOCK_UPDATE_REPLICA;
+ io.pos = pos;
+ io.length = len;
+ io.block = move(block);
+ replicate_message(&io);
+
+ } else {
+ INFO("Block replica %s updated real host", block.first.c_str());
+ }
+ return true;
+}
+// }}}
+}
diff --git a/src/blocknode/block_node.hh b/src/blocknode/block_node.hh
new file mode 100644
index 0000000..517531d
--- /dev/null
+++ b/src/blocknode/block_node.hh
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "../nodes/node.hh"
+#include "local_io.hh"
+#include "../messages/IOoperation.hh"
+#include
+
+namespace eclipse {
+
+using vec_str = std::vector;
+
+class BlockNode: public Node {
+ public:
+ BlockNode (network::ClientHandler*);
+ ~BlockNode ();
+
+ //! @brief Save to disk a block and replicate.
+ bool block_insert_local(Block&, bool replicate = true);
+
+ //! @brief Delete Local block
+ bool block_delete_local(Block&, bool replicate = true);
+
+ //! @brief Update the content of the block.
+ bool block_update_local(Block& block, uint32_t pos, uint32_t len, bool replicate = true);
+
+ //! @brief Read block from the local node.
+ bool block_read_local(Block& block, uint64_t off = 0, uint64_t len = 0, bool ignore_params = true);
+
+ protected:
+ void replicate_message(messages::IOoperation*);
+
+ Local_io local_io;
+ int network_size;
+};
+
+}
diff --git a/src/blocknode/block_node_router.cc b/src/blocknode/block_node_router.cc
new file mode 100644
index 0000000..44ee4e2
--- /dev/null
+++ b/src/blocknode/block_node_router.cc
@@ -0,0 +1,80 @@
+#include "block_node_router.hh"
+#include "../common/context_singleton.hh"
+#include "../messages/boost_impl.hh"
+#include
+#include