{
30 |
31 | public T value;
32 |
33 | public Holder() {
34 | }
35 |
36 | public Holder(T value) {
37 | this.value = value;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/ILocalLockManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | /**
24 | * Handle locks by key
25 | *
26 | * @author enrico.olivelli
27 | */
28 | public interface ILocalLockManager {
29 |
30 | LockHandle acquireReadLockForKey(Bytes key);
31 |
32 | LockHandle acquireWriteLockForKey(Bytes key);
33 |
34 | void clear();
35 |
36 | void releaseLock(LockHandle handle);
37 |
38 | void releaseReadLock(LockHandle handle);
39 |
40 | void releaseWriteLock(LockHandle handle);
41 |
42 | int getNumKeys();
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/IllegalDataAccessException.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | /**
24 | * An illegal access to data
25 | *
26 | * @author enrico.olivelli
27 | */
28 | public class IllegalDataAccessException extends RuntimeException {
29 |
30 | public IllegalDataAccessException(String message) {
31 | super(message);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/IntHolder.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
24 |
25 | /**
26 | * Holds a native {@code int} value.
27 | *
28 | * @author diego.salvi
29 | */
30 | @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
31 | public class IntHolder {
32 |
33 | public int value;
34 |
35 | public IntHolder() {
36 | this.value = 0;
37 | }
38 |
39 | public IntHolder(int value) {
40 | this.value = value;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/KeyValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
24 |
25 | /**
26 | * Key + Value
27 | *
28 | * @author enrico.olivelli
29 | */
30 | @SuppressFBWarnings("EI2")
31 | public class KeyValue {
32 |
33 | public final Bytes key;
34 | public final Bytes value;
35 |
36 | public KeyValue(Bytes key, Bytes value) {
37 | this.key = key;
38 | this.value = value;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/LockAcquireTimeoutException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to Diennea S.r.l. under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. Diennea S.r.l. licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | *
19 | */
20 | package herddb.utils;
21 |
22 | import herddb.core.HerdDBInternalException;
23 |
24 | /**
25 | * Timeout.
26 | */
27 | public final class LockAcquireTimeoutException extends HerdDBInternalException {
28 |
29 | public LockAcquireTimeoutException(String message) {
30 | super(message);
31 | }
32 |
33 | public LockAcquireTimeoutException(String message, Throwable cause) {
34 | super(message, cause);
35 | }
36 |
37 | public LockAcquireTimeoutException(Throwable cause) {
38 | super(cause);
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/LongHolder.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
24 |
25 | /**
26 | * Holds a native {@code long} value.
27 | *
28 | * @author enrico.olivelli
29 | */
30 | @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
31 | public class LongHolder {
32 |
33 | public long value;
34 |
35 | public LongHolder() {
36 | }
37 |
38 | public LongHolder(long value) {
39 | this.value = value;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/NonClosingInputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | import java.io.FilterInputStream;
24 | import java.io.IOException;
25 | import java.io.InputStream;
26 |
27 | /**
28 | * {@link FilterInputStream} implementation which doesn't propagate {@link #close()} invocations.
29 | *
30 | * Usefull when wrapped stream musn't be close but you want to wrap it in a try-with-resources manner
31 | *
32 | *
33 | * @author diego.salvi
34 | */
35 | public class NonClosingInputStream extends FilterInputStream {
36 |
37 | public NonClosingInputStream(InputStream in) {
38 | super(in);
39 | }
40 |
41 | @Override
42 | public void close() throws IOException {
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/NullOutputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | import java.io.IOException;
24 | import java.io.OutputStream;
25 |
26 | /**
27 | * Null Output Stream
28 | *
29 | * @author enrico.olivelli
30 | */
31 | public final class NullOutputStream extends OutputStream {
32 |
33 | public static final NullOutputStream INSTANCE = new NullOutputStream();
34 |
35 | @Override
36 | public void write(int b) throws IOException {
37 | }
38 |
39 | @Override
40 | public void write(byte[] b, int off, int len) throws IOException {
41 | }
42 |
43 | @Override
44 | public void write(byte[] b) throws IOException {
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/herddb-utils/src/main/java/herddb/utils/SizeAwareObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
20 |
21 | package herddb.utils;
22 |
23 | /**
24 | * Represent an object aware of his heap size.
25 | *
26 | * @author diego.salvi
27 | */
28 | public interface SizeAwareObject {
29 |
30 | /**
31 | * Returns an estimation of the heap size of this instance.
32 | *
33 | * @return size estimation in bytes
34 | */
35 | long getEstimatedSize();
36 | }
37 |
--------------------------------------------------------------------------------
/herddb-website/src/site/resources/images/herddb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-website/src/site/resources/images/herddb.png
--------------------------------------------------------------------------------
/licences/bookkeeper.NOTICE.txt:
--------------------------------------------------------------------------------
1 | Apache BookKeeper
2 | Copyright 2011 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
7 |
--------------------------------------------------------------------------------
/licences/zookeeper.NOTICE.txt:
--------------------------------------------------------------------------------
1 | Apache ZooKeeper
2 | Copyright 2009-2014 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/licenseheader.txt:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to Diennea S.r.l. under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. Diennea S.r.l. licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 |
19 | */
--------------------------------------------------------------------------------
/ycsb-runner/cluster.properties:
--------------------------------------------------------------------------------
1 | # Licensed to Diennea S.r.l. under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. Diennea S.r.l. licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | db.driver=herddb.jdbc.Driver
19 | db.url=jdbc:herddb:zookeeper:localhost:2181
20 | db.user=sa
21 | db.passwd=hdb
22 |
--------------------------------------------------------------------------------
/ycsb-runner/herd.properties:
--------------------------------------------------------------------------------
1 | # Licensed to Diennea S.r.l. under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. Diennea S.r.l. licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | db.driver=herddb.jdbc.Driver
19 | db.url=jdbc:herddb:server:127.0.0.1:7000
20 | db.user=sa
21 | db.passwd=hdb
22 |
--------------------------------------------------------------------------------
/ycsb-runner/metrics.sh:
--------------------------------------------------------------------------------
1 | #/usr/bin/env bash
2 | # Licensed to Diennea S.r.l. under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. Diennea S.r.l. licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing,
13 | # software distributed under the License is distributed on an
14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | # KIND, either express or implied. See the License for the
16 | # specific language governing permissions and limitations
17 | # under the License.
18 |
19 | DATE=$(date '+%Y-%m-%d-%H-%M-%S')
20 | workload=$1
21 | separator="_"
22 | type=$2
23 | metrics="metrics"
24 | host=$(hostname) #hostname
25 | url="http://$host:9845/metrics"
26 | folder="target/metrics/"
27 | filename="metrics"
28 | name="$folder$workload$separator$type$separator$metrics"
29 | extension=".log"
30 |
31 |
32 | mkdir -p $folder
33 |
34 |
35 | wget $url -P $folder #dowload metrics from url and save it in target/metrics
36 |
37 | if [[ -e $name$extension ]]; then
38 | i=1
39 | while [[ -e $name.$i$extension ]]; do
40 | let i++
41 | done
42 | name=$name.$i
43 | fi
44 |
45 | mv $folder$filename $name$extension #change file name
46 |
--------------------------------------------------------------------------------
/ycsb-runner/prepare.sh:
--------------------------------------------------------------------------------
1 | #/usr/bin/env bash
2 | # Licensed to Diennea S.r.l. under one
3 | # or more contributor license agreements. See the NOTICE file
4 | # distributed with this work for additional information
5 | # regarding copyright ownership. Diennea S.r.l. licenses this file
6 | # to you under the Apache License, Version 2.0 (the
7 | # "License"); you may not use this file except in compliance
8 | # with the License. You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing,
13 | # software distributed under the License is distributed on an
14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | # KIND, either express or implied. See the License for the
16 | # specific language governing permissions and limitations
17 | # under the License.
18 |
19 | cd ..
20 | JAVA_HOME=~/dev/jdk-12 mvn clean install -DskipTests
21 | cd herddb-services/target
22 | unzip herddb-services*zip
23 | cd ../../ycsb-runner
24 | cp setsenv_bench_jdk11.sh ../herddb-services/target/herddb-service*-SNAPSHOT/bin/setenv.sh
25 |
--------------------------------------------------------------------------------