@@ -115,6 +115,8 @@ public class CassandraBlobStore extends AbstractComponent implements BlobStore {
115
115
116
116
private final String keyspace ;
117
117
118
+ private final String hostAndPort ;
119
+
118
120
private final CassandraClientFactory cassandraClientFactory ;
119
121
120
122
private final Executor executor ;
@@ -129,18 +131,19 @@ public CassandraBlobStore(Settings settings, Executor executor) {
129
131
130
132
String host = settings .get ("host" , "localhost" );
131
133
int port = settings .getAsInt ("port" , 9160 );
134
+ hostAndPort = host + ':' + port ;
132
135
cassandraClientFactory = new CassandraClientFactory (host , port );
133
136
134
137
this .executor = executor ;
135
138
136
139
this .bufferSizeInBytes = (int ) settings .getAsBytesSize ("buffer_size" , new ByteSizeValue (100 , ByteSizeUnit .KB )).bytes ();
137
140
138
- logger .debug ("CassandraBlobStore {}:{} executor: {} bufferSizeInBytes: {}" ,
139
- host , port , executor , bufferSizeInBytes );
141
+ logger .debug ("CassandraBlobStore {} executor: {} bufferSizeInBytes: {}" ,
142
+ this , executor , bufferSizeInBytes );
140
143
}
141
144
142
145
@ Override public String toString () {
143
- return "cassandra" ; // XXX
146
+ return hostAndPort ;
144
147
}
145
148
146
149
/* XXX
@@ -165,7 +168,7 @@ public int bufferSizeInBytes() {
165
168
}
166
169
catch (IOException ex ) {
167
170
// Oh well, nothing we can do but log.
168
- logger .warn ("delete {} failed" , ex , blobPath );
171
+ logger .warn ("delete {} failed on {} " , ex , blobPath , this );
169
172
}
170
173
}
171
174
@@ -314,16 +317,16 @@ ImmutableMap<String, BlobMetaData> listBlobsByPrefix(String blobPath, @Nullable
314
317
ConsistencyLevel .QUORUM );
315
318
}
316
319
catch (InvalidRequestException ex ) {
317
- throw new IOException ("Cassandra get_slice on ???:??? failed" , ex );
320
+ throw new IOException ("Cassandra get_slice failed on " + this , ex );
318
321
}
319
322
catch (UnavailableException ex ) {
320
- throw new IOException ("Cassandra get_slice on ???:??? failed" , ex );
323
+ throw new IOException ("Cassandra get_slice failed on " + this , ex );
321
324
}
322
325
catch (TimedOutException ex ) {
323
- throw new IOException ("Cassandra get_slice on ???:??? failed" , ex );
326
+ throw new IOException ("Cassandra get_slice failed on " + this , ex );
324
327
}
325
328
catch (TException ex ) {
326
- throw new IOException ("Cassandra get_slice on ???:??? failed" , ex );
329
+ throw new IOException ("Cassandra get_slice failed on " + this , ex );
327
330
}
328
331
finally {
329
332
cassandraClientFactory .closeCassandraClient (client );
0 commit comments