Skip to content

Commit

Permalink
OakHashMap Api (#161)
Browse files Browse the repository at this point in the history
* started OakHashMap

* OakHashMap cont

* done OakHashMap

* reformat code

* Hashcode type added

* hash function wrapper

* reformat code

* issue #141

* reformat code

* removed oakhashFunction

* OakHashMapBuilder removed

* concurrentzcmap

* removed InternalOakHashMap

* reformat code

* templated tests

* renamed check to checkPreconditions

* replaced getvalue mannager with memorySize()

* seperated mapapi tests and paramterizedMapApiTest

* changed mapapi tests
  • Loading branch information
OrHayat authored Jun 21, 2021
1 parent c2c882e commit 91da8fb
Show file tree
Hide file tree
Showing 30 changed files with 1,371 additions and 228 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static class BenchmarkState {
@Setup()
public void setup() {
OakMapBuilder<String, String> builder = OakCommonBuildersFactory.getDefaultStringBuilder();
oakMap = builder.build();
oakMap = builder.buildOrderedMap();

keys = new ArrayList<>(numRows);
for (int i = 0; i < numRows; ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static class BenchmarkState {
@Setup(Level.Iteration)
public void setup() {
OakMapBuilder<String, String> builder = OakCommonBuildersFactory.getDefaultStringBuilder();
oakMap = builder.build();
oakMap = builder.buildOrderedMap();
}

@TearDown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ScanBenchmark {
@Setup
public void setup() {
OakMapBuilder<String, String> builder = OakCommonBuildersFactory.getDefaultStringBuilder();
oakMap = builder.build();
oakMap = builder.buildOrderedMap();

for (int i = 0; i < numRows; ++i) {
String key = String.format("%0$" + KEY_SIZE_BYTES / Character.BYTES + "s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public OakMyBufferMap() {
MyBuffer.DEFAULT_COMPARATOR, MyBuffer.DEFAULT_SERIALIZER, MyBuffer.DEFAULT_SERIALIZER, minKey)
.setChunkMaxItems(Chunk.MAX_ITEMS_DEFAULT)
.setMemoryAllocator(ma);
oak = builder.build();
oak = builder.buildOrderedMap();
}

public long allocated() {
Expand Down Expand Up @@ -140,7 +140,7 @@ public void clear() {
MyBuffer.DEFAULT_COMPARATOR, MyBuffer.DEFAULT_SERIALIZER, MyBuffer.DEFAULT_SERIALIZER, minKey)
.setChunkMaxItems(Chunk.MAX_ITEMS_DEFAULT)
.setMemoryAllocator(ma);
oak = builder.build();
oak = builder.buildOrderedMap();
}

@Override
Expand Down
16 changes: 16 additions & 0 deletions core/src/main/java/com/yahoo/oak/ConcurrentZCMap.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright 2020, Verizon Media.
* Licensed under the terms of the Apache 2.0 license.
* Please see LICENSE file in the project root for terms.
*/

package com.yahoo.oak;

import java.io.Closeable;
import java.util.concurrent.ConcurrentMap;

public interface ConcurrentZCMap<K , V> extends ConcurrentMap<K , V>, Closeable {
ZeroCopyMap<K , V> zc();
long memorySize();
void close();
}
Loading

0 comments on commit 91da8fb

Please sign in to comment.