Permalink
Browse files

Move channels to its own module to start repackaging as releasable

  • Loading branch information...
nitsanw committed Sep 27, 2017
1 parent 28e2f67 commit 6c2f0abe0d5fe769a7a83d84669a0f31c4e7e00d
Showing with 58 additions and 53 deletions.
  1. +6 −1 jctools-benchmarks/pom.xml
  2. +38 −0 jctools-channels/pom.xml
  3. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/Channel.java
  4. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/ChannelConsumer.java
  5. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/ChannelProducer.java
  6. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/ChannelReceiver.java
  7. 0 ...tal → jctools-channels}/src/main/java/org/jctools/channels/OffHeapFixedMessageSizeRingBuffer.java
  8. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/WaitStrategy.java
  9. 0 ...s-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/ClassViewModel.java
  10. 0 ...tal → jctools-channels}/src/main/java/org/jctools/channels/mapping/InvalidInterfaceException.java
  11. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/Mapper.java
  12. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/Primitive.java
  13. 0 ...ls-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/TypeInspector.java
  14. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mapping/Variable.java
  15. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscChannel.java
  16. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscChannelConsumer.java
  17. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscChannelProducer.java
  18. 0 ...ls-channels}/src/main/java/org/jctools/channels/mpsc/MpscFFLamportOffHeapFixedSizeRingBuffer.java
  19. 0 ...l → jctools-channels}/src/main/java/org/jctools/channels/mpsc/MpscOffHeapFixedSizeRingBuffer.java
  20. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/LocalsHelper.java
  21. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/ProxyChannel.java
  22. 0 ...xperimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/ProxyChannelFactory.java
  23. 0 ...rimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/ProxyChannelRingBuffer.java
  24. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/proxy/package-info.java
  25. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscChannel.java
  26. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscChannelConsumer.java
  27. 0 ...experimental → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscChannelProducer.java
  28. 0 ...l → jctools-channels}/src/main/java/org/jctools/channels/spsc/SpscOffHeapFixedSizeRingBuffer.java
  29. +2 −3 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/CompilationResult.java
  30. 0 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/SimpleCompiler.java
  31. +1 −2 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/StringWrappingJavaFile.java
  32. {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/Template.java
  33. +2 −44 {jctools-experimental → jctools-channels}/src/main/java/org/jctools/util/UnsafeDirectByteBuffer.java
  34. 0 ...rimental → jctools-channels}/src/main/resources/org/jctools/channels/ChannelConsumerTemplate.java
  35. 0 ...rimental → jctools-channels}/src/main/resources/org/jctools/channels/ChannelProducerTemplate.java
  36. 0 ... jctools-channels}/src/test/java/org/jctools/channels/AbstractOffHeapFixedSizeRingBufferTest.java
  37. 0 ...rimental → jctools-channels}/src/test/java/org/jctools/channels/mapping/InvalidInterfaceTest.java
  38. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/channels/mapping/MapperTest.java
  39. 0 ...ls-experimental → jctools-channels}/src/test/java/org/jctools/channels/mapping/StubFlyweight.java
  40. 0 ...jctools-channels}/src/test/java/org/jctools/channels/mpsc/MpscOffHeapFixedSizeRingBufferTest.java
  41. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/channels/proxy/DemoIFace.java
  42. 0 ...ls-experimental → jctools-channels}/src/test/java/org/jctools/channels/proxy/DemoProxyResult.java
  43. 0 ...-experimental → jctools-channels}/src/test/java/org/jctools/channels/proxy/ProxyCreationTest.java
  44. 0 ...ols-experimental → jctools-channels}/src/test/java/org/jctools/channels/spsc/SpscChannelTest.java
  45. 0 ...jctools-channels}/src/test/java/org/jctools/channels/spsc/SpscOffHeapFixedSizeRingBufferTest.java
  46. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/util/CompilerTest.java
  47. 0 {jctools-experimental → jctools-channels}/src/test/java/org/jctools/util/TemplateTest.java
  48. 0 ...xperimental → jctools-channels}/src/test/resources/org/jctools/channels/mapping/StubTemplate.java
  49. +5 −0 jctools-experimental/pom.xml
  50. +1 −0 pom.xml
@@ -12,7 +12,7 @@
<name>Benchmarks</name>
<properties>
<jmh-core.version>1.14</jmh-core.version>
<jmh-core.version>1.19</jmh-core.version>
</properties>
<dependencies>
@@ -21,6 +21,11 @@
<artifactId>jctools-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-channels</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-experimental</artifactId>
View
@@ -0,0 +1,38 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jctools</groupId>
<artifactId>jctools-parent</artifactId>
<version>2.2-SNAPSHOT</version>
</parent>
<artifactId>jctools-channels</artifactId>
<name>Channel implementations</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>5.1</version>
</dependency>
</dependencies>
</project>
File renamed without changes.
@@ -13,11 +13,10 @@
*/
package org.jctools.util;
import static java.util.Collections.unmodifiableList;
import javax.tools.Diagnostic;
import java.util.List;
import javax.tools.Diagnostic;
import static java.util.Collections.unmodifiableList;
public final class CompilationResult {
@@ -13,9 +13,8 @@
*/
package org.jctools.util;
import java.net.URI;
import javax.tools.SimpleJavaFileObject;
import java.net.URI;
/**
* A Java file object which is used to represent the Java source code coming from a string.
@@ -13,16 +13,16 @@
*/
package org.jctools.util;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
/**
* A single class templating library for doing runtime code-gen.
*
@@ -3,7 +3,8 @@
import java.nio.Buffer;
import java.nio.ByteBuffer;
public class UnsafeDirectByteBuffer {
public class UnsafeDirectByteBuffer
{
private static final long addressOffset;
static {
try {
@@ -18,20 +19,6 @@ public static long getAddress(ByteBuffer buffy) {
return UnsafeAccess.UNSAFE.getLong(buffy, addressOffset);
}
/**
* put byte and skip position update and boundary checks
*
* @param buffy
* @param b
*/
public static void putByte(long address, int position, byte b) {
UnsafeAccess.UNSAFE.putByte(address + position, b);
}
public static void putByte(long address, byte b) {
UnsafeAccess.UNSAFE.putByte(address, b);
}
public static ByteBuffer allocateAlignedByteBuffer(int capacity, long align) {
if (Long.bitCount(align) != 1) {
throw new IllegalArgumentException("Alignment must be a power of 2");
@@ -60,33 +47,4 @@ public static ByteBuffer alignedSlice(int capacity, long align,
return slice;
}
}
public static boolean isPageAligned(ByteBuffer buffy) {
return isPageAligned(getAddress(buffy));
}
/**
* This assumes cache line is 64b
*/
public static boolean isCacheAligned(ByteBuffer buffy) {
return isCacheAligned(getAddress(buffy));
}
public static boolean isPageAligned(long address) {
return (address & (UnsafeJvmInfo.PAGE_SIZE - 1)) == 0;
}
/**
* This assumes cache line is 64b
*/
public static boolean isCacheAligned(long address) {
return (address & (PortableJvmInfo.CACHE_LINE_SIZE - 1)) == 0;
}
public static boolean isAligned(long address, long align) {
if (Long.bitCount(align) != 1) {
throw new IllegalArgumentException("Alignment must be a power of 2");
}
return (address & (align - 1)) == 0;
}
}
@@ -17,6 +17,11 @@
<artifactId>jctools-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-channels</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
View
@@ -59,6 +59,7 @@
<modules>
<module>jctools-core</module>
<module>jctools-experimental</module>
<module>jctools-channels</module>
<module>jctools-benchmarks</module>
<module>jctools-concurrency-test</module>
<module>jctools-build</module>

0 comments on commit 6c2f0ab

Please sign in to comment.