更新依赖;去除无用代码
This commit is contained in:
parent
b0f27784dc
commit
55c28d358c
@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="MavenProjectsManager">
|
<component name="MavenProjectsManager">
|
||||||
@ -7,7 +8,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
40
pom.xml
40
pom.xml
@ -9,8 +9,8 @@
|
|||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-all</artifactId>
|
<artifactId>netty-all</artifactId>
|
||||||
<version>4.1.86.Final</version>
|
<version>4.1.101.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.28</version>
|
<version>1.18.30</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.8.18</version>
|
<version>5.8.20</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -61,26 +61,30 @@
|
|||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.graalvm.buildtools</groupId>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>native-maven-plugin</artifactId>
|
||||||
<version>3.4.2</version>
|
<version>0.9.28</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<id>native</id>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>single</goal>
|
<goal>compile-no-fork</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
<phase>package</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<descriptorRefs>
|
<mainClass>lion.Main</mainClass>
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
<imageName>storageNode</imageName>
|
||||||
</descriptorRefs>
|
<fallback>false</fallback>
|
||||||
<archive>
|
<verbose>true</verbose>
|
||||||
<manifest>
|
<quickBuild>true</quickBuild>
|
||||||
<mainClass>lion.Main</mainClass>
|
<buildArgs>
|
||||||
</manifest>
|
<arg>-H:+ReportExceptionStackTraces</arg>
|
||||||
</archive>
|
</buildArgs>
|
||||||
|
<metadataRepository>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</metadataRepository>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
@ -1,17 +1,7 @@
|
|||||||
package lion;
|
package lion;
|
||||||
|
|
||||||
import lion.ErrorCode.ErrorCode;
|
|
||||||
import lombok.extern.log4j.Log4j;
|
import lombok.extern.log4j.Log4j;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.channels.FileChannel;
|
|
||||||
import java.nio.channels.SocketChannel;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.nio.file.StandardOpenOption;
|
|
||||||
|
|
||||||
|
|
||||||
@Log4j
|
@Log4j
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
@ -21,8 +11,4 @@ public class Main {
|
|||||||
|
|
||||||
new storageNode();
|
new storageNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,6 @@ public class MessageCodec extends ByteToMessageCodec<AbstractMessage> {
|
|||||||
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
|
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
|
||||||
byte messageType = byteBuf.readByte();
|
byte messageType = byteBuf.readByte();
|
||||||
int length = byteBuf.readInt();
|
int length = byteBuf.readInt();
|
||||||
System.out.println(length);
|
|
||||||
byte[] bytes = new byte[length];
|
byte[] bytes = new byte[length];
|
||||||
byteBuf.readBytes(bytes);
|
byteBuf.readBytes(bytes);
|
||||||
final String metadata = new String(bytes, StandardCharsets.UTF_8);
|
final String metadata = new String(bytes, StandardCharsets.UTF_8);
|
||||||
|
|||||||
@ -18,8 +18,7 @@ public class MultiThreadedHTTPServer {
|
|||||||
String real_ip;
|
String real_ip;
|
||||||
try{
|
try{
|
||||||
real_ip = InetAddress.getByName("lionwebsite.xyz").getHostAddress();
|
real_ip = InetAddress.getByName("lionwebsite.xyz").getHostAddress();
|
||||||
}
|
} catch (UnknownHostException ignored){
|
||||||
catch (UnknownHostException ignored){
|
|
||||||
real_ip = "207.60.50.74";
|
real_ip = "207.60.50.74";
|
||||||
}
|
}
|
||||||
try(ServerSocket serverSocket = new ServerSocket(PORT)) {
|
try(ServerSocket serverSocket = new ServerSocket(PORT)) {
|
||||||
|
|||||||
@ -59,10 +59,8 @@ public class storageNode {
|
|||||||
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(100000000, 1, 4));
|
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(100000000, 1, 4));
|
||||||
channel.pipeline().addLast(new MessageCodec());
|
channel.pipeline().addLast(new MessageCodec());
|
||||||
channel.pipeline().addLast(new MyChannelInboundHandlerAdapter(tempQueue));
|
channel.pipeline().addLast(new MyChannelInboundHandlerAdapter(tempQueue));
|
||||||
|
|
||||||
}
|
}
|
||||||
}).option(ChannelOption.SO_BACKLOG, 128)
|
})
|
||||||
.childOption(ChannelOption.SO_KEEPALIVE, true)
|
|
||||||
.bind(26321);
|
.bind(26321);
|
||||||
log.info("listen port:8080");
|
log.info("listen port:8080");
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user