MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / readAll

Method readAll

samples/JGroups/src/S3_PING.java:99–131  ·  view source on GitHub ↗
(String clustername)

Source from the content-addressed store, hash-verified

97 }
98
99 protected List<PingData> readAll(String clustername) {
100 if(clustername == null)
101 return null;
102
103 List<PingData> retval=new ArrayList<PingData>();
104 try {
105 ListBucketResponse rsp=conn.listBucket(location, clustername, null, null, null);
106 if(rsp.entries != null) {
107 for(Iterator<ListEntry> it=rsp.entries.iterator(); it.hasNext();) {
108 ListEntry key=it.next();
109 GetResponse val=conn.get(location, key.key, null);
110 if(val.object != null) {
111 byte[] buf=val.object.data;
112 if(buf != null) {
113 try {
114 PingData data=(PingData)Util.objectFromByteBuffer(buf);
115 retval.add(data);
116 }
117 catch(Exception e) {
118 log.error("failed marshalling buffer to address", e);
119 }
120 }
121 }
122 }
123 }
124
125 return retval;
126 }
127 catch(IOException ex) {
128 log.error("failed reading addresses", ex);
129 return retval;
130 }
131 }
132
133
134 protected void writeToFile(PingData data, String clustername) {

Callers

nothing calls this directly

Calls 5

addMethod · 0.80
nextMethod · 0.65
getMethod · 0.65
listBucketMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected