feat: remove unused functions

remove event-related functions from NodeCenterConn
This commit is contained in:
Frank.R.Wu 2021-12-06 17:55:59 +08:00
parent b0ef7bbf10
commit 42baeaeef6
2 changed files with 8 additions and 33 deletions

View File

@ -65,12 +65,6 @@ public class ByteUtil {
bo.write(i & 0xff);
}
public static void writeLong(ByteArrayOutputStream bo, long l) {
for (int i = 56; i >= 0; i -= 8) {
bo.write(((int) (l >> i)) & 0xff);
}
}
public static long readLong(ByteArrayInputStream bi) {
long ret = 0L;
for (int i = 0; i < 8; i++) {
@ -80,11 +74,15 @@ public class ByteUtil {
return ret;
}
public static void writeLong(ByteArrayOutputStream bo, long l) {
for (int i = 56; i >= 0; i -= 8) {
bo.write(((int) (l >> i)) & 0xff);
}
}
public static byte[] readBytes(ByteArrayInputStream bi, int len) {
byte[] ret = new byte[len];
bi.read(ret, 0, len);
return ret;
}
}

View File

@ -3,14 +3,10 @@ package org.bdware.sc;
import com.google.gson.JsonObject;
import org.zz.gmhelper.SM2KeyPair;
import java.math.BigInteger;
public interface NodeCenterConn {
boolean deliverEvent(String event, String target);
String[] listNodes();
NodeKey[] listNodes();
String getNodeId(String str);
String getNodeId();
String routeContract(String contractID);
@ -22,25 +18,6 @@ public interface NodeCenterConn {
JsonObject checkIsContract(String requestID, String json);
/**
* get k nearest nodes to the key in the hash function range
*
* @param key the key
* @param k the number of required node ids
* @return ids of k nearest nodes
*/
String[] getClusterByKey(String key, int k);
class NodeKey {
public String id;
public BigInteger biId;
public NodeKey(String id) {
this.id = id;
this.biId = new BigInteger(id, 16);
}
}
class Response {
String responseID;
String action;