public static byte[] toBytes(List<SpanPack> packs) { if (packs == null) return null; try { int size = packs.size(); DataOutputX dout = new DataOutputX(size * 300); for (int i = 0; i < size; i++) { dout.writePack(packs.get(i)); } return dout.toByteArray(); } catch (IOException e) { } return null; }
public static byte[] toBytes(List<SpanPack> packs) { if (packs == null) return null; try { int size = packs.size(); DataOutputX dout = new DataOutputX(size * 300); for (int i = 0; i < size; i++) { dout.writePack(packs.get(i)); } return dout.toByteArray(); } catch (IOException e) { } return null; }
public static byte[] toBytes(List<SpanPack> packs) { if (packs == null) return null; try { int size = packs.size(); DataOutputX dout = new DataOutputX(size * 300); for (int i = 0; i < size; i++) { dout.writePack(packs.get(i)); } return dout.toByteArray(); } catch (IOException e) { } return null; }
public static byte[] toBytes(List<SpanPack> packs) { if (packs == null) return null; try { int size = packs.size(); DataOutputX dout = new DataOutputX(size * 300); for (int i = 0; i < size; i++) { dout.writePack(packs.get(i)); } return dout.toByteArray(); } catch (IOException e) { } return null; }
public static byte[] toBytes(SpanPack[] pack) { if (pack == null) return null; try { DataOutputX dout = new DataOutputX(pack.length * 300); for (int i = 0; i < pack.length; i++) { dout.writePack(pack[i]); } return dout.toByteArray(); } catch (IOException e) { } return null; }
public static byte[] toBytes(SpanPack[] pack) { if (pack == null) return null; try { DataOutputX dout = new DataOutputX(pack.length * 300); for (int i = 0; i < pack.length; i++) { dout.writePack(pack[i]); } return dout.toByteArray(); } catch (IOException e) { } return null; }
public static byte[] toBytes(SpanPack[] pack) { if (pack == null) return null; try { DataOutputX dout = new DataOutputX(pack.length * 300); for (int i = 0; i < pack.length; i++) { dout.writePack(pack[i]); } return dout.toByteArray(); } catch (IOException e) { } return null; }
public static byte[] toBytes(SpanPack[] pack) { if (pack == null) return null; try { DataOutputX dout = new DataOutputX(pack.length * 300); for (int i = 0; i < pack.length; i++) { dout.writePack(pack[i]); } return dout.toByteArray(); } catch (IOException e) { } return null; }
private void sendCounter(PerfCounterPack[] p) { try { List<byte[]> buff = new ArrayList<byte[]>(); int bytes = 0; for (int k = 0; k < p.length; k++) { byte[] b = new DataOutputX().writePack(p[k]).toByteArray(); if (bytes + b.length >= conf.net_udp_packet_max_bytes) { sendDirect(buff); // buff.size가 0일수도 있다. bytes = 0;// bytes 값 초기화.. buff.clear(); } bytes += b.length; buff.add(b); } sendDirect(buff); } catch (Exception e) { } }
public static void sendCounter(PerfCounterPack[] p) { // udp.add(p); try { List<byte[]> buff = new ArrayList<byte[]>(); int bytes = 0; for (int k = 0; k < p.length; k++) { byte[] b = new DataOutputX().writePack(p[k]).toByteArray(); if (bytes + b.length >= conf.net_udp_packet_max_bytes) { sendDirect(buff); // buff.size가 0일수도 있다. bytes = 0;// bytes 값 초기화.. buff.clear(); } bytes += b.length; buff.add(b); } sendDirect(buff); } catch (Exception e) { } }
private static void sendDirect(Pack p) { try { udpNet.write(new DataOutputX().writePack(p).toByteArray()); } catch (IOException e) { } }
public boolean add(Pack p) { try { byte[] b = new DataOutputX().writePack(p).toByteArray(); Object ok = queue.push(b); return ok != null; } catch (Exception e) { } return false; }
public static void sendDirect(Pack p) { try { udpNet.write(new DataOutputX().writePack(p).toByteArray()); } catch (IOException e) { } } private static void sendDirect(List<byte[]> buff) {
public static void sendDirect(Pack p) { try { udpNet.write(new DataOutputX().writePack(p).toByteArray()); } catch (IOException e) { } } private static void sendDirect(List<byte[]> buff) {
public boolean add(Pack p) { try { byte[] b = new DataOutputX().writePack(p).toByteArray(); Object ok = queue.push(b); return ok != null; } catch (Exception e) { } return false; }
static public void sendUdpPackToServer(Pack pack){ Configure conf = Configure.getInstance(); try { UdpAgent.sendUdp(conf.net_collector_ip, conf.net_collector_udp_port, new DataOutputX().write(NetCafe.CAFE).writePack(pack).toByteArray()); } catch (Exception e) { e.printStackTrace(); } }
public static void sendHeartBeat(ObjectPack p) { try { udpCollect.write(new DataOutputX().writePack(p).toByteArray()); } catch (Exception e) { } if (conf.log_udp_object) { Logger.info(p.toString()); } }
@ServiceHandler(RequestCmd.CHECK_JOB) public void checkJob(DataInputX din, DataOutputX dout, boolean login) throws IOException { MapPack param = (MapPack) din.readPack(); long session = param.getLong("session"); RemoteControl control = RemoteControlManager.getCommand(session); if (control != null) { TextPack t = new TextPack(); t.text = control.commnad(); dout.writeByte(TcpFlag.HasNEXT); dout.writePack(t); dout.writeByte(TcpFlag.HasNEXT); dout.writePack(control.param()); } } private long collectDirectory(File dir, ListValue nameLv, ListValue sizeLv, ListValue lastModifiedLv,
public static void sendError(int hash, String message) { if (errText.contains(hash)) { return; } errText.put(hash); try { udpCollect.write(new DataOutputX().writePack(new TextPack(TextTypes.ERROR, hash, message)).toByteArray()); } catch (Exception e) { } }
private static void passToNetDataProcessor(Pack pack, InetAddress addr) throws IOException { DataOutputX out = new DataOutputX(); out.write(NetCafe.CAFE); out.write(new DataOutputX().writePack(pack).toByteArray()); NetDataProcessor.add(out.toByteArray(), addr); }