Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Support publishing to sonatype.
Browse files Browse the repository at this point in the history
  • Loading branch information
lingjun-cg committed Oct 9, 2021
1 parent 270bf33 commit abee794
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 10 deletions.
58 changes: 58 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,38 @@
<groupId>com.alibaba</groupId>
<artifactId>session-compatible-fast-serializer</artifactId>
<version>1.0.0</version>
<name>session-compatible-fast-serializer</name>
<description>A fast and compatible serializer base on kryo</description>
<url>https://github.com/alibaba/session-compatible-fast-serializer</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>https://github.com/alibaba/session-compatible-fast-serializer.git</connection>
<developerConnection>https://github.com/alibaba/session-compatible-fast-serializer.git</developerConnection>
<url>https://github.com/alibaba/session-compatible-fast-serializer</url>
</scm>
<developers>
<developer>
<id>lingjun</id>
<name>lingjun</name>
<email>lingjun.cg@alibaba-inc.com</email>
</developer>
</developers>
<distributionManagement>
<snapshotRepository>
<id>oss</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>oss</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
Expand All @@ -29,6 +61,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* Instead of reading directly from java.io.InputStream.
* Because byte arrays can be randomly read and written, we can avoid using Chunk-based temporary buffers to achieve compatibility.
*
* @param <T>
* @param <T> Object type that need to serialize and deserialize.
*/
public class FastCachedCompatibleFieldSerializer<T> extends FieldSerializer<T> {
public static final int SHORTER_FIELD_LEN = 255;
Expand Down Expand Up @@ -93,9 +93,9 @@ public FastCachedCompatibleFieldSerializer(Kryo kryo, Class type, FastCachedComp
* <li>Object metadata sent only once</li>
* <li>Type encoding for known types and Encode variable-length fields</li>
* </ul>
* @param kryo
* @param output
* @param object
* @param kryo current kryo instance
* @param output object will write to
* @param object object need to serialize
*/
public void write(Kryo kryo, Output output, T object) {
int pop = pushTypeVariables();
Expand Down Expand Up @@ -224,10 +224,10 @@ private int readIntAt(byte[] buffer, int p) {

/**
* Cache layout compare result for deserialization
* @param kryo
* @param input
* @param type
* @return
* @param kryo kryo instance
* @param input Deserialize input
* @param type Deserialize object type
* @return Deserialize result
*/
public T read(Kryo kryo, Input input, Class<? extends T> type) {
int pop = pushTypeVariables();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/alibaba/kryo/serializer/SessionKryo.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ private int getClassOutputSize(Class type) {
}

/**
* java.util.PriorityQueue cannot accept a size < 1,so it throw exception when read a empty PriorityQueue.
* Handle this is simple,always make sure not pass a size <1 to constructor.
* java.util.PriorityQueue cannot accept a size less than 1,so it throw exception when read a empty PriorityQueue.
* Handle this is simple,always make sure not pass a size less than 1 to constructor.
*/
public static class CanEmptyPriorityQueueSerializer extends DefaultSerializers.PriorityQueueSerializer {
@Override
Expand Down

0 comments on commit abee794

Please sign in to comment.