Skip to content

Commit

Permalink
Merge pull request #1 from tushengxia/main
Browse files Browse the repository at this point in the history
Init repo directories and Move hbase repo
  • Loading branch information
Jutao-liu authored Apr 14, 2022
2 parents 7e23aa8 + 1cde127 commit 4bb36bc
Show file tree
Hide file tree
Showing 571 changed files with 117,783 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.iml
*.ipr
*.iws
.idea/
target/
28 changes: 28 additions & 0 deletions hbase-tries-index/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# hbase-trie-index



Introduction
============
The trie index library is used to accelerate HBase Data Block selection. By using Succinct Data Structure instead of ArrayList, trie index costs less memory and performs more efficiently. The trie index library is based on the original APIs of Apache [HBase 2.2.3](https://github.com/apache/hbase/tree/rel/2.2.3).




Building And Packageing
====================

(1) Build the project:

mvn clean package


Contribution Guidelines
========

Track the bugs and feature requests via GitHub [issues].

More Information
========

For further assistance, send an email to [email protected].
6 changes: 6 additions & 0 deletions hbase-tries-index/fake-tries-index-pack/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.huawei</groupId>
<artifactId>fake-tries-index-pack</artifactId>
<version>2.2.3</version>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/
package com.huawei.boostkit.hbase.index;

import java.nio.ByteBuffer;

/**
* Allocated memory by unsafe
*
* @since 2021.09
*/
public class AllocatedMemory {
public ByteBuffer getBuf() {
return null;
}

public void retain() {
}

public void release() {
}

public int refCnt() {
return 0;
}

public int size() {return 0;}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/
package com.huawei.boostkit.hbase.index;

/**
* Illegal Memory Request Exception
*
* @since 2021.09
*/
public class IllegalMemoryRequestException extends Exception {
public IllegalMemoryRequestException(long requestMemorySize) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/
package com.huawei.boostkit.hbase.index;

/**
* Insufficient memory exception
*
* @since 2021.09
*/
public class InsufficientMemoryException extends Exception {
public InsufficientMemoryException(long memoryGap) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/
package com.huawei.boostkit.hbase.index;

import java.io.DataOutput;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.List;

/**
* Louds Tries Map service
*
* @since 2021.09
*/
public class LoudsTriesService {

public static void build(List<byte[]> keys, long[] offsets, int[] lengths, DataOutput out) throws IOException {
}

public static ValueInfo get(ByteBuffer buff, byte[] key, int offset, int length) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/
package com.huawei.boostkit.hbase.index;

/**
* Direct memory allocator with maximum memory
* memory is free manually
*
* @since 2021.09
*/
public class NativeMaxLimitAllocator {


public NativeMaxLimitAllocator(long maxMemorySize) {
}

public AllocatedMemory allocate(int size) throws InsufficientMemoryException, IllegalMemoryRequestException {
return null;
}

public long getMaxMemory() {
return 0;
}

public long getMemoryUsed() {
return 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.huawei.boostkit.hbase.index;

public class OffheapLruCache<KEYTYPE> {
public OffheapLruCache(long maxMemorySize, float reserveRatio, long evaluatedBlockSize) {
}

public void putCache(KEYTYPE cacheKey, OffheapReplaceableCache cacheable)
throws InsufficientMemoryException, IllegalMemoryRequestException {
}

public OffheapReplaceableCache getCache(KEYTYPE cacheKey) {
return null;
}

public boolean containsKey(KEYTYPE cacheKey) {
return false;
}

public void returnCache(OffheapReplaceableCache value) {
}

public long getMaxMemory() {
return 0;
}

public void shutdown() {
}
public void activateEvictThread(){}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.huawei.boostkit.hbase.index;

public interface OffheapReplaceableCache {
void retain();
void release();
int dataSize();
OffheapReplaceableCache replace(AllocatedMemory allocate);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/
package com.huawei.boostkit.hbase.index;

/**
* Value info
*
* @since 2021.09
*/
public class ValueInfo {
public final long blockOffset;
public final int blockLength;

public ValueInfo(long blockOffset, int blockLength) {
this.blockOffset = blockOffset;
this.blockLength = blockLength;
}
}
Loading

0 comments on commit 4bb36bc

Please sign in to comment.