Skip to content

Commit 09069d0

Browse files
committed
Release v1.0.3
1 parent e3fbbef commit 09069d0

File tree

13 files changed

+17
-432
lines changed

13 files changed

+17
-432
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project (Skywalker C CXX)
88

99
set(SKYWALKER_VERSION_MAJOR 1)
1010
set(SKYWALKER_VERSION_MINOR 0)
11-
set(SKYWALKER_VERSION_PATCH 2)
11+
set(SKYWALKER_VERSION_PATCH 3)
1212
set(SKYWALKER_VERSION_STRING ${SKYWALKER_VERSION_MAJOR}.${SKYWALKER_VERSION_MINOR}.${SKYWALKER_VERSION_PATCH})
1313

1414
enable_testing()

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ default: all
5353

5454
SHARED_VERSION_MAJOR = 1
5555
SHARED_VERSION_MINOR = 0
56-
SHARED_VERSION_PATCH = 2
56+
SHARED_VERSION_PATCH = 3
5757
SHARED_LIB1 = libskywalker.$(PLATFORM_SHARED_EXT)
5858
SHARED_LIB2 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR)
5959
SHARED_LIB3 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR).${SHARED_VERSION_PATCH}

examples/echo/echo.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#include <inttypes.h>
65
#include <stdio.h>
76
#include <stdlib.h>
87
#include <unistd.h>
@@ -27,13 +26,14 @@ int main(int argc, char** argv) {
2726
return -1;
2827
}
2928

29+
skywalker::Checkpoint checkpoint;
3030
skywalker::GroupOptions g_options;
3131
g_options.use_master = true;
3232
g_options.log_sync = true;
3333
g_options.sync_interval = 0;
3434
g_options.keep_log_count = 1000;
3535
g_options.log_storage_path = std::string(path);
36-
g_options.checkpoint = new skywalker::Checkpoint();
36+
g_options.checkpoint = &checkpoint;
3737

3838
skywalker::Options options;
3939

@@ -72,7 +72,6 @@ int main(int argc, char** argv) {
7272
});
7373
}
7474

75-
delete g_options.checkpoint;
7675
delete node;
7776

7877
return 0;

examples/journey/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set_source_files_properties(${proto_srcs} ${proto_hdrs} PROPERTIES COMPILE_FLAGS
55
add_executable(journey_client journey_client.cc ${proto_srcs})
66
target_link_libraries(journey_client ${Skywalker_LINKER_LIBS} ${Skywalker_LINK})
77

8-
add_executable(journey_server murmurhash3.cc journey_server.cc
8+
add_executable(journey_server journey_server.cc
99
journey_service_impl.cc
1010
journey_db_machine.cc journey_db.cc
1111
${proto_srcs})

examples/journey/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ all: journey_client journey_server
3636
journey_client: journey.pb.o journey_client.o
3737
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
3838

39-
journey_server: murmurhash3.o journey_db.o journey_db_machine.o \
39+
journey_server: journey_db.o journey_db_machine.o \
4040
journey.pb.o journey_service_impl.o journey_server.o
4141
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
4242

examples/journey/checkpoint_impl.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

examples/journey/journey_server.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#include <inttypes.h>
65
#include <stdio.h>
76
#include <stdlib.h>
87
#include <unistd.h>
@@ -16,7 +15,6 @@
1615
#include <voyager/rpc/rpc_server.h>
1716
#include <voyager/util/string_util.h>
1817

19-
#include "checkpoint_impl.h"
2018
#include "journey_service_impl.h"
2119

2220
int main(int argc, char** argv) {
@@ -30,15 +28,15 @@ int main(int argc, char** argv) {
3028
printf("getcwd error\n");
3129
return -1;
3230
}
33-
skywalker::Checkpoint* checkpoint = new journey::CheckpointImpl();
3431

32+
skywalker::Checkpoint checkpoint;
3533
skywalker::GroupOptions g_options;
3634
g_options.use_master = true;
3735
g_options.log_sync = true;
3836
g_options.sync_interval = 0;
3937
g_options.keep_log_count = 1000;
4038
g_options.log_storage_path = std::string(path);
41-
g_options.checkpoint = checkpoint;
39+
g_options.checkpoint = &checkpoint;
4240

4341
skywalker::Options options;
4442

@@ -82,7 +80,5 @@ int main(int argc, char** argv) {
8280
loop.Loop();
8381
}
8482

85-
delete checkpoint;
86-
8783
return 0;
8884
}

examples/journey/journey_service_impl.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <functional>
88
#include <iostream>
99

10-
#include "murmurhash3.h"
10+
#include <voyager/util/hash.h>
1111

1212
namespace journey {
1313

@@ -85,9 +85,10 @@ void JourneyServiceImpl::Propose(google::protobuf::RpcController* controller,
8585

8686
uint32_t JourneyServiceImpl::Shard(const std::string& key) {
8787
assert(group_size_ > 0);
88-
uint32_t out;
89-
MurmurHash3_x86_32(key.c_str(), static_cast<int>(key.size()), 0, &out);
90-
return (out & (group_size_ - 1));
88+
if (group_size_ == 1) {
89+
return 0;
90+
}
91+
return voyager::Hash32(key) % group_size_;
9192
}
9293

9394
} // namespace journey

0 commit comments

Comments
 (0)