Browse Source

code style

pull/3/MERGE
CalvinKirs 4 years ago
parent
commit
93fb043be3
  1. 5
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/codec/NettyDecoder.java
  2. 2
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/config/ServiceBean.java
  3. 3
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/protocol/MessageHeader.java
  4. 2
      dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/protocol/RpcProtocol.java

5
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/codec/NettyDecoder.java

@ -17,7 +17,6 @@
package org.apache.dolphinscheduler.rpc.codec; package org.apache.dolphinscheduler.rpc.codec;
import org.apache.dolphinscheduler.rpc.serializer.ProtoStuffUtils;
import org.apache.dolphinscheduler.rpc.serializer.RpcSerializer; import org.apache.dolphinscheduler.rpc.serializer.RpcSerializer;
import org.apache.dolphinscheduler.rpc.serializer.Serializer; import org.apache.dolphinscheduler.rpc.serializer.Serializer;
@ -52,10 +51,10 @@ public class NettyDecoder extends ByteToMessageDecoder {
byteBuf.resetReaderIndex(); byteBuf.resetReaderIndex();
} }
byte serializerType=1; byte serializerType = 1;
byte[] data = new byte[dataLength]; byte[] data = new byte[dataLength];
byteBuf.readBytes(data); byteBuf.readBytes(data);
Serializer serializer=RpcSerializer.getSerializerByType(serializerType); Serializer serializer = RpcSerializer.getSerializerByType(serializerType);
Object obj = serializer.deserialize(data, genericClass); Object obj = serializer.deserialize(data, genericClass);
list.add(obj); list.add(obj);
} }

2
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/config/ServiceBean.java

@ -46,7 +46,7 @@ public class ServiceBean {
private static synchronized void init() { private static synchronized void init() {
// todo config // todo config
if(initialized.get()){ if (initialized.get()) {
return; return;
} }
Reflections f = new Reflections("org/apache/dolphinscheduler/"); Reflections f = new Reflections("org/apache/dolphinscheduler/");

3
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/protocol/MessageHeader.java

@ -19,7 +19,7 @@ package org.apache.dolphinscheduler.rpc.protocol;
public class MessageHeader { public class MessageHeader {
private byte magic=(byte) 0xbabe; private byte magic = (byte) 0xbabe;
/** /**
* context length * context length
@ -40,7 +40,6 @@ public class MessageHeader {
private byte serialization; private byte serialization;
public int getContextLength() { public int getContextLength() {
return contextLength; return contextLength;
} }

2
dolphinscheduler-remote/src/main/java/org/apache/dolphinscheduler/rpc/protocol/RpcProtocol.java

@ -17,7 +17,7 @@
package org.apache.dolphinscheduler.rpc.protocol; package org.apache.dolphinscheduler.rpc.protocol;
public class RpcProtocol<T>{ public class RpcProtocol<T> {
private MessageHeader msgHeader; private MessageHeader msgHeader;

Loading…
Cancel
Save