-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rocketmq builder compatible metaq fixed message systemmessage not set in deepcopy fixed script compile script expression bugs window fire support test model
- Loading branch information
1 parent
750b04e
commit f261840
Showing
22 changed files
with
160 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
...ients/src/main/java/org/apache/rocketmq/streams/client/strategy/ConfiguableConnector.java
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
...eams-clients/src/main/java/org/apache/rocketmq/streams/client/strategy/StateStrategy.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
...-commons/src/main/java/org/apache/rocketmq/streams/common/cache/compress/BitSetCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package org.apache.rocketmq.streams.common.cache.compress; | ||
|
||
import org.apache.rocketmq.streams.common.utils.NumberUtils; | ||
|
||
public class BitSetCache { | ||
protected ByteArrayValueKV cache; | ||
protected int byteSetSize; | ||
protected int capacity; | ||
|
||
private class BitSet{ | ||
private byte[] bytes; | ||
|
||
public BitSet(){ | ||
bytes=new byte[byteSetSize]; | ||
} | ||
public BitSet(byte[] bytes){ | ||
this.bytes=bytes; | ||
} | ||
public void set(int index){ | ||
if(index>byteSetSize){ | ||
throw new RuntimeException("the index exceed max index, max index is "+byteSetSize+", real is "+index); | ||
} | ||
int byteIndex=index/8; | ||
int bitIndex=index%8; | ||
byte byteElement=bytes[byteIndex]; | ||
byteElement = (byte) (byteElement|(1 << bitIndex)); | ||
bytes[byteIndex]=byteElement; | ||
} | ||
public boolean get(int index){ | ||
if(index>byteSetSize){ | ||
throw new RuntimeException("the index exceed max index, max index is "+byteSetSize+", real is "+index); | ||
} | ||
int byteIndex=index/8; | ||
int bitIndex=index%8; | ||
byte byteElement=bytes[byteIndex]; | ||
boolean isTrue = ((byteElement & (1 << bitIndex)) != 0); | ||
return isTrue; | ||
} | ||
|
||
public byte[] getBytes(){ | ||
return bytes; | ||
} | ||
} | ||
|
||
public BitSet createBitSet(){ | ||
return new BitSet(); | ||
} | ||
|
||
|
||
public BitSetCache(int bitSetSize, int capacity){ | ||
cache=new ByteArrayValueKV(capacity,true); | ||
this.byteSetSize=bitSetSize/8+bitSetSize%8; | ||
this.capacity=capacity; | ||
} | ||
|
||
|
||
public void put(String key,BitSet bitSet){ | ||
if(cache.size>cache.capacity){ | ||
synchronized (this){ | ||
if(cache.size>cache.capacity){ | ||
cache=new ByteArrayValueKV(capacity,true); | ||
} | ||
} | ||
} | ||
cache.put(key,bitSet.getBytes()); | ||
|
||
} | ||
|
||
public static void main(String[] args) { | ||
BitSetCache bitSetCache=new BitSetCache(150,30000); | ||
BitSet bitSet=bitSetCache.createBitSet(); | ||
bitSet.set(13); | ||
bitSetCache.put("fdsdf",bitSet); | ||
BitSet bitSet1=bitSetCache.get("fdsdf"); | ||
System.out.println(bitSet1.get(13)); | ||
} | ||
|
||
public BitSet get(String key){ | ||
byte[] bytes=cache.get(key); | ||
if(bytes==null){ | ||
return null; | ||
} | ||
return new BitSet(bytes); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,8 @@ | |
String value() default ""; | ||
|
||
String aliasName() default ""; | ||
|
||
|
||
|
||
String name() default ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.