Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
70891d8
Bump version
mashtizadeh Jan 17, 2014
785ed36
Some test harness to exercise the RKChunker code on standalone files.
mashtizadeh Jan 19, 2014
c4f835d
Adding errno.h to rkchunker_test.cc as linux requires it, but OS X in…
mashtizadeh Jan 20, 2014
56bcf91
Commit out hashing for now in the test binary. Seems to break the ti…
mashtizadeh Jan 20, 2014
2b11e1b
Fix build.
mashtizadeh Jan 20, 2014
e5791b4
Fix default PREFIX=/usr/local
raimue Feb 25, 2014
48862f2
Move to C++11
mashtizadeh Oct 10, 2014
b5aa960
Interactive mode for oridbg
mashtizadeh Oct 10, 2014
d077c57
Prevent creating empty packfiles when closing an unmodified repository.
mashtizadeh Nov 7, 2014
90accea
More C++11 modernization
mashtizadeh Nov 7, 2014
73b8009
orisync C++11 modernization
mashtizadeh Nov 7, 2014
b474674
Modernize ori cli
mashtizadeh Nov 7, 2014
d8e9aa4
Removing oris3 and libs3
mashtizadeh Nov 7, 2014
4aef316
Add warning on time out of sync
Nov 26, 2014
62fa9e2
orisync server should wait for worker threads to quit
Nov 28, 2014
3b28afc
orisync repocontrol pull should treat pullResp 0 as error
Nov 28, 2014
453daaf
Automatic snapshot support
Nov 28, 2014
af6df01
local repo initial version
pkuforest Nov 29, 2014
34c30ca
local repo fix
pkuforest Nov 29, 2014
8cf93a9
before push local repo
pkuforest Nov 29, 2014
c5f290e
Merge remote-tracking branch 'sync/master'
pkuforest Nov 29, 2014
8ce6c9b
Add multiuser support
Nov 30, 2014
edb8aca
support for uds server of orisync, only "cmd_add" is correct by now
pkuforest Dec 2, 2014
5068a20
Merge branch 'master' of bitbucket.org:orifs/ori-orisyncng
pkuforest Dec 2, 2014
2624317
Add server status to serverinfo
Dec 2, 2014
a6c0c60
Merge branch 'master' of https://bitbucket.org/orifs/ori-orisyncng
Dec 2, 2014
cd3243e
added orisyncclient.h
pkuforest Dec 2, 2014
46f901c
Merge branch 'master' of https://bitbucket.org/orifs/ori-orisyncng
Dec 2, 2014
0ceff02
fix compile problem
pkuforest Dec 2, 2014
739b17c
Merge branch 'master' of https://bitbucket.org/orifs/ori-orisyncng
Dec 2, 2014
294e89f
changed server to thread, add/remove repo working
pkuforest Dec 3, 2014
09a164b
Add cluster status CLI
Dec 3, 2014
5b4df1d
merge hostinfo.h
Dec 3, 2014
3bd8237
delete -> delete[]
mashtizadeh Dec 3, 2014
0cc47b3
Merge branch 'master' of bitbucket.org:orifs/ori
mashtizadeh Dec 3, 2014
e437d1d
Implemented purge snapshot for orifs
mashtizadeh Dec 3, 2014
bcba89d
Remove warning from release builds
mashtizadeh Dec 4, 2014
7f36265
orisync status support; merge announcer and repomonitor; add performa…
Dec 6, 2014
bf2aae8
orisync Listener now uses CV to signal Syncer
Dec 7, 2014
5069b62
Merge https://bitbucket.org/orifs/ori
Dec 7, 2014
1e043ab
Add garbage collection support; Fix some previous purgesnapshot/pull …
Dec 9, 2014
3f8fa24
Make repos in myInfo persist across orisync life; Repos now have know…
Dec 10, 2014
761371d
orisync list can show online peers
Dec 10, 2014
801dc86
add orisync/cmd_exit.cc
Dec 10, 2014
fd2434e
Support adaptive snapshot
Dec 10, 2014
cabd56d
Add more robust locking and error handling
Dec 11, 2014
c2496d8
fix hostadd and hostremove
Dec 12, 2014
6a4af92
Test script now supports running tests individually.
Dec 12, 2014
04a8f3e
Add orisync test file
Dec 13, 2014
09e7558
Updating AUTHORS file
mashtizadeh Mar 30, 2015
cc7853e
Fix OS X build
mashtizadeh Apr 13, 2015
9ef2034
Code cleanup
mashtizadeh Apr 13, 2015
64eeded
Fix warning in fdstream
mashtizadeh Apr 13, 2015
8daf193
Fixing format specifier portability issues
mashtizadeh Apr 14, 2015
16126e1
Removing most boost dependencies
mashtizadeh Apr 15, 2015
ef44bae
Removed boost depedency
mashtizadeh Apr 15, 2015
a713c11
Correct spelling errors detected by Debian QA tools
0xaf1f Jul 18, 2015
de17442
Escape nroff "-" to be interpreted as minus sign for program options
0xaf1f Jul 18, 2015
8ae99f4
Use orifs binary as defined in run_tests environment variable
0xaf1f Jul 27, 2015
5162de3
Merged in aelghraoui/ori/debian-patch-forwarding (pull request #6)
Aug 20, 2015
83382b5
Merged in raimue/ori/bogus-prefix (pull request #5)
Aug 14, 2016
d0715f3
Fix some build/test compat issues on Linux/BSDs
mashtizadeh Aug 14, 2016
9d8fb12
Merge branch 'master' of bitbucket.org:orifs/ori
mashtizadeh Aug 14, 2016
ab10b1b
Remove references to old s3 backup prototype
mashtizadeh Nov 26, 2016
d51d3c7
Adjust to openssl 1.1.x api
tomasbrod Mar 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Ali Mashtizadeh <mashti@cs.stanford.edu>
Frank Huang <fyhuang@stanford.edu>
Daniel Jackoway <danjdel@gmail.com>
Philip Zhuang <pzhuang@stanford.edu>
Yinglei Wang <yw437@cornell.edu>
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Build Dependencies:
- pkg-config

Dependences:
- C++11 (Required)
- openssl (tested with 1.0.1+) (Required)
- boost headers (tested with 1.48+) (Required)
- libevent 2.0 (Required)
- FUSE (API Version 26+)
- liblzma (for LZMA compression)
- mDNSResponder (for Multipull Support)
- libexecinfo (FreeBSD only)
- libxml2 (S3 Backup)
- libedit (oridbg only)

Build flags can be added to 'Local.sc' in the root directory, or through the
command line. The available options can be displayed by typing 'scons --help'.
Expand Down
63 changes: 11 additions & 52 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ def CheckPkgMinVersion(context, name, version):
opts = Variables('Local.sc')

opts.AddVariables(
("CC", "C Compiler"),
("CXX", "C++ Compiler"),
("AS", "Assembler"),
("LINK", "Linker"),
("CC", "C Compiler", "cc"),
("CXX", "C++ Compiler", "c++"),
("AS", "Assembler", "as"),
("LINK", "Linker"), # SCons usually runs $CC or $CXX
("AR", "Archiver", "ar"),
("RANLIB", "Archiver Indexer", "ranlib"),
("NUMCPUS", "Number of CPUs to use for build (0 means auto)", 0, None, int),
EnumVariable("BUILDTYPE", "Build type", "RELEASE", ["RELEASE", "DEBUG", "PERF"]),
BoolVariable("VERBOSE", "Show full build information", 0),
Expand All @@ -44,14 +46,12 @@ opts.AddVariables(
BoolVariable("WITH_GOOGLEPROF", "Link to Google CPU Profiler", 0),
BoolVariable("WITH_TSAN", "Enable Clang Race Detector", 0),
BoolVariable("WITH_ASAN", "Enable Clang AddressSanitizer", 0),
BoolVariable("WITH_LIBS3", "Include support for Amazon S3", 0),
BoolVariable("BUILD_BINARIES", "Build binaries", 1),
BoolVariable("CROSSCOMPILE", "Cross compile", 0),
BoolVariable("USE_FAKES3", "Send S3 requests to fakes3 instead of Amazon", 0),
EnumVariable("HASH_ALGO", "Hash algorithm", "SHA256", ["SHA256"]),
EnumVariable("COMPRESSION_ALGO", "Compression algorithm", "FASTLZ", ["LZMA", "FASTLZ", "SNAPPY", "NONE"]),
EnumVariable("CHUNKING_ALGO", "Chunking algorithm", "RK", ["RK", "FIXED"]),
PathVariable("PREFIX", "Installation target directory", "/usr/local/bin/", PathVariable.PathAccept),
PathVariable("PREFIX", "Installation target directory", "/usr/local", PathVariable.PathAccept),
PathVariable("DESTDIR", "The root directory to install into. Useful mainly for binary package building", "", PathVariable.PathAccept),
)

Expand Down Expand Up @@ -121,12 +121,6 @@ else:
if not env["WITH_MDNS"]:
env.Append(CPPFLAGS = [ "-DWITHOUT_MDNS" ])

if env["WITH_LIBS3"]:
env.Append(CPPFLAGS = [ "-DWITH_LIBS3" ])

if env["USE_FAKES3"]:
env.Append(CPPDEFINES = ['USE_FAKES3'])

if env["WITH_GPROF"]:
env.Append(CPPFLAGS = [ "-pg" ])
env.Append(LINKFLAGS = [ "-pg" ])
Expand All @@ -139,7 +133,7 @@ elif env["BUILDTYPE"] == "PERF":
env.Append(CPPFLAGS = [ "-g", "-DNDEBUG", "-DORI_PERF", "-Wall", "-O2"])
env.Append(LDFLAGS = [ "-g", "-rdynamic" ])
elif env["BUILDTYPE"] == "RELEASE":
env.Append(CPPFLAGS = ["-DNDEBUG", "-DORI_RELEASE", "-Wall", "-O2"])
env.Append(CPPFLAGS = ["-DNDEBUG", "-DORI_RELEASE", "-w", "-O2"])
else:
print "Error BUILDTYPE must be RELEASE or DEBUG"
sys.exit(-1)
Expand Down Expand Up @@ -193,8 +187,6 @@ elif sys.platform == "linux2" or sys.platform == "darwin":
env.Append(CPPFLAGS = "-DHAVE_EXECINFO")

if sys.platform == "win32":
env.Append(LIBPATH=['#../boost_1_53_0\stage\lib'],
CPPPATH=['#../boost_1_53_0'])
env.Append(LIBPATH=['#../libevent-2.0.21-stable'],
CPPPATH=['#../libevent-2.0.21-stable\include'])

Expand All @@ -213,6 +205,7 @@ if not conf.CheckCC():
print 'Your C compiler and/or environment is incorrectly configured.'
CheckFailed()

env.AppendUnique(CXXFLAGS = ['-std=c++11'])
if not conf.CheckCXX():
print 'Your C++ compiler and/or environment is incorrectly configured.'
CheckFailed()
Expand All @@ -225,35 +218,8 @@ else:
print 'pkg-config not found!'
Exit(1)

#
#env.AppendUnique(CXXFLAGS = ['-std=c++11'])
#if not conf.CheckCXX():
# env['CXXFLAGS'].remove('-std=c++11')
#
#env.AppendUnique(CXXFLAGS = ['-std=c++0x'])
#if not conf.CheckCXX():
# env['CXXFLAGS'].remove('-std=c++0x')
#

if conf.CheckCXXHeader('unordered_map'):
env.Append(CPPFLAGS = "-DHAVE_CXX11")
elif conf.CheckCXXHeader('tr1/unordered_map'):
env.Append(CPPFLAGS = "-DHAVE_CXXTR1")
else:
print 'Either C++11, C++0x, or C++ TR1 must be present!'
CheckFailed()

if not conf.CheckCXXHeader('boost/uuid/uuid.hpp'):
print 'Boost UUID headers are missing!'
Exit(1)

if not conf.CheckCXXHeader('boost/bind.hpp'):
print 'Boost bind headers are missing!'
Exit(1)

if not conf.CheckCXXHeader('boost/date_time/posix_time/posix_time.hpp'):
print 'Boost posix_time headers are missing!'
Exit(1)
if not conf.CheckCXXHeader('unordered_map'):
print 'C++11 libraries appear to be missing'

if sys.platform.startswith("freebsd"):
if not conf.CheckLib('execinfo'):
Expand Down Expand Up @@ -326,9 +292,6 @@ if sys.platform != "win32" and sys.platform != "darwin":
env.Append(LIBS = ["pthread"])

# Optional Components
if env["WITH_LIBS3"]:
env.Append(CPPPATH = '#libs3-2.0/inc')
SConscript('libs3-2.0/SConscript', variant_dir='build/libs3-2.0')
if env["COMPRESSION_ALGO"] == "SNAPPY":
env.Append(CPPPATH = ['#snappy-1.0.5'])
env.Append(LIBS = ["snappy"], LIBPATH = ['#build/snappy-1.0.5'])
Expand Down Expand Up @@ -363,8 +326,6 @@ if env["BUILD_BINARIES"]:
SConscript('ori/SConscript', variant_dir='build/ori')
SConscript('oridbg/SConscript', variant_dir='build/oridbg')
SConscript('orisync/SConscript', variant_dir='build/orisync')
if env["WITH_LIBS3"]:
SConscript('oris3/SConscript', variant_dir='build/oris3')
if env["WITH_FUSE"]:
SConscript('orifs/SConscript', variant_dir='build/orifs')
if env["WITH_HTTPD"]:
Expand All @@ -378,8 +339,6 @@ if env["WITH_FUSE"]:
env.Install('$DESTDIR$PREFIX/bin','build/ori/ori')
env.Install('$DESTDIR$PREFIX/bin','build/oridbg/oridbg')
env.Install('$DESTDIR$PREFIX/bin','build/orisync/orisync')
if env["WITH_LIBS3"]:
env.Install('$DESTDIR$PREFIX/bin','build/ori/oris3')
if env["WITH_HTTPD"]:
env.Install('$DESTDIR$PREFIX/bin','build/ori_httpd/ori_httpd')
if env["WITH_ORILOCAL"]:
Expand Down
8 changes: 4 additions & 4 deletions docs/ori.1
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ This list contains commands that will operate on your local instance of the
repository. These may callout to remote repositories for data if this was an
InstaCloned repository.
.TP
\fBcheckout\fR [--force] \fICOMMIT-HASH\fR
\fBcheckout\fR [\-\-force] \fICOMMIT-HASH\fR
Checkout a revision of the repository. By default this applies the current
modified files onto the specified revision, but for most users the merge
command is a safer alternative. The --force flag is used to discard current
command is a safer alternative. The \-\-force flag is used to discard current
changes and checkout the revision specified.
.TP
\fBlog\fR
Expand All @@ -45,7 +45,7 @@ Remove the specified file system.
\fBshow\fR
Show repository information.
.TP
\fBsnapshot\fR [-m \fIMESSAGE\fR] [\fISNAPSHOT-NAME\fR]
\fBsnapshot\fR [\-m \fIMESSAGE\fR] [\fISNAPSHOT-NAME\fR]
Take a snapshot of the repository. You may optionally supply a message to be
included and a name.
.TP
Expand All @@ -65,7 +65,7 @@ repository named \fIorigin\fR is used as the default for certain operations
that take an optional remote name. At the moment an InstaCloned repository can
only be created with \fBorifs\fR.
.TP
\fBreplicate\fR [--ondemand] \fISOURCE-PATH\fR
\fBreplicate\fR [\-\-ondemand] \fISOURCE-PATH\fR
Clone a remote or local repository into a new directory.
.TP
\fBpull\fR [\fIPATH|REMOTE-NAME\fR]
Expand Down
2 changes: 1 addition & 1 deletion docs/oridbg.1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Remove the specified file system.
\fBshow\fR
Show repository information.
.TP
\fBsnapshot\fR [-m \fIMESSAGE\fR] [\fISNAPSHOT-NAME\fR]
\fBsnapshot\fR [\-m \fIMESSAGE\fR] [\fISNAPSHOT-NAME\fR]
Take a snapshot of the repository. You may optionally supply a message to be
included and a name.
.TP
Expand Down
16 changes: 8 additions & 8 deletions docs/orifs.1
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ bug will addressed.

.SH OPTIONS
.TP
\fB\--repo=[\fIFS-NAME\fR]\fR
\fB\-\-repo=[\fIFS-NAME\fR]\fR
Specify the path to the underlying repository. This parameter is optional and
by default orifs will search for a file system with the same name as the mount
point.
.TP
\fB\--clone=[\fIREMOTEPATH\fR]\fR
\fB\-\-clone=[\fIREMOTEPATH\fR]\fR
Replicate the file system from the specified repository.
.TP
\fB\--shallow\fR
Used in conjunction with --clone to specify a shallow replica of the remote
\fB\-\-shallow\fR
Used in conjunction with \-\-clone to specify a shallow replica of the remote
repository.
.TP
\fB\--nocache\fR
Used in conjunction with --clone to specify a non-caching replica of the remote
\fB\-\-nocache\fR
Used in conjunction with \-\-clone to specify a non-caching replica of the remote
repository.
.TP
\fB\--no-threads\fR
\fB\-\-no-threads\fR
Disable multithreading on FUSE.
.TP
\fB\--debug\fR
\fB\-\-debug\fR
Enable debugging mode with verbose output. The file system will run much
slower, but is useful for reporting crashes.

Expand Down
1 change: 1 addition & 0 deletions libori/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ env.StaticLibrary("ori", src)

# Test Binaries
if env["BUILD_BINARIES"]:
#env.Program("rkchunker_test", "rkchunker_test.cc")
env.Program("rkchunker", "rkchunker.cc")
env.Program("fchunker", "fchunker.cc")

11 changes: 6 additions & 5 deletions libori/fchunker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cinttypes>

#include <time.h>
#include <sys/time.h>
Expand Down Expand Up @@ -106,7 +107,7 @@ int main(int argc, char *argv[])
float tDiff = end.tv_sec - start.tv_sec;
tDiff += (float)(end.tv_usec - start.tv_usec) / 10000000.0;

printf("Chunks %llu, Avg Chunk %llu\n", cb.chunks, cb.chunkLen / cb.chunks);
printf("Chunks %" PRIu64 ", Avg Chunk %" PRIu64 "\n", cb.chunks, cb.chunkLen / cb.chunks);
printf("Time %3.3f, Speed %3.2fMB/s\n", tDiff, 1024.0 / tDiff);

assert(cb.chunks == TEST_LEN / CHUNK_LEN);
Expand Down
14 changes: 7 additions & 7 deletions libori/httprepo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@

#include <openssl/sha.h>

#include <boost/date_time/posix_time/posix_time.hpp>

#include <oriutil/debug.h>
#include <oriutil/oriutil.h>
#include <oriutil/stopwatch.h>
#include <ori/object.h>
#include <ori/httpclient.h>
#include <ori/httprepo.h>
Expand Down Expand Up @@ -92,15 +91,16 @@ HttpRepo::getHead()
int
HttpRepo::distance()
{
boost::posix_time::ptime t_begin =
boost::posix_time::microsec_clock::local_time();
Stopwatch sw;

sw.start();

std::string uuid = getUUID();
assert(uuid != "");

sw.stop();

boost::posix_time::ptime t_end =
boost::posix_time::microsec_clock::local_time();
return (t_end - t_begin).total_milliseconds();
return sw.getElapsedMS();
}

Object::sp
Expand Down
6 changes: 6 additions & 0 deletions libori/httpserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ HTTPServer::start(bool mDNSEnable)
event_base_dispatch(base);
}

void
HTTPServer::stop()
{
event_base_loopexit(base, NULL);
}

void
HTTPServer::entry(struct evhttp_request *req)
{
Expand Down
3 changes: 1 addition & 2 deletions libori/index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <string>
#include <set>
#include <iostream>
#include <boost/tr1/unordered_map.hpp>
#include <unordered_map>

#include <oriutil/debug.h>
#include <oriutil/runtimeexception.h>
Expand All @@ -37,7 +37,6 @@
#include <ori/index.h>

using namespace std;
using namespace std::tr1;

/// Adds a checksum
#define TOTAL_ENTRYSIZE (IndexEntry::SIZE + 16)
Expand Down
27 changes: 11 additions & 16 deletions libori/largeblob.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include <stdio.h>
#include <stdint.h>
#include <string.h>

#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <cinttypes>

#include <unistd.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -268,13 +268,13 @@ LargeBlob::read(uint8_t *buf, size_t s, off_t off) const
}

if (it == parts.end()) {
LOG("offset %llu larger than large blob", off);
LOG("offset %" PRIu64 " larger than large blob", off);
return 0;
}

off_t part_off = off - (*it).first;
if (part_off >= (*it).second.length) {
LOG("offset %llu larger than last blob in LB", off);
LOG("offset %" PRIu64 " larger than last blob in LB", off);
ASSERT(false);
return 0;
}
Expand Down Expand Up @@ -310,12 +310,9 @@ LargeBlob::getBlob()
size_t num = parts.size();
ss.writeUInt64(num);

for (map<uint64_t, LBlobEntry>::iterator it = parts.begin();
it != parts.end();
it++)
{
ss.writeHash((*it).second.hash);
ss.writeUInt16((*it).second.length);
for (auto &it : parts) {
ss.writeHash(it.second.hash);
ss.writeUInt16(it.second.length);
}

return ss.str();
Expand Down Expand Up @@ -345,10 +342,8 @@ size_t
LargeBlob::totalSize() const
{
size_t total = 0;
for (map<uint64_t, LBlobEntry>::const_iterator it = parts.begin();
it != parts.end(); it++)
{
total += (*it).second.length;
for (auto const &it : parts) {
total += it.second.length;
}

return total;
Expand Down
Loading