Skip to content

Commit 9bb3217

Browse files
IGNITE-27829 Java thin: Add cache name to exceptions with cache operations
1 parent 9975117 commit 9bb3217

File tree

13 files changed

+1508
-1206
lines changed

13 files changed

+1508
-1206
lines changed

modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientServicesImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ClientServicesImpl implements ClientServices {
5757
static final int SRV_TOP_UPDATE_PERIOD = 60_000;
5858

5959
/** Channel. */
60-
private final ReliableChannel ch;
60+
private final ReliableChannelImpl ch;
6161

6262
/** Binary marshaller. */
6363
private final ClientBinaryMarshaller marsh;
@@ -75,7 +75,7 @@ class ClientServicesImpl implements ClientServices {
7575
private final Map<String, ServiceTopology> servicesTopologies;
7676

7777
/** Constructor. */
78-
ClientServicesImpl(ReliableChannel ch, ClientBinaryMarshaller marsh, ClientClusterGroupImpl grp, IgniteLogger log) {
78+
ClientServicesImpl(ReliableChannelImpl ch, ClientBinaryMarshaller marsh, ClientClusterGroupImpl grp, IgniteLogger log) {
7979
this.ch = ch;
8080
this.marsh = marsh;
8181
this.grp = grp;

modules/core/src/main/java/org/apache/ignite/internal/client/thin/ClientUtils.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.apache.ignite.cache.QueryIndexType;
4949
import org.apache.ignite.cache.query.SqlFieldsQuery;
5050
import org.apache.ignite.client.ClientCacheConfiguration;
51+
import org.apache.ignite.client.ClientFeatureNotSupportedByServerException;
5152
import org.apache.ignite.internal.binary.BinaryContext;
5253
import org.apache.ignite.internal.binary.BinaryFieldMetadata;
5354
import org.apache.ignite.internal.binary.BinaryMetadata;
@@ -369,16 +370,17 @@ void cacheConfiguration(ClientCacheConfiguration cfg, boolean sql, BinaryOutputS
369370
});
370371
}
371372
else if (cfg.getExpiryPolicy() != null) {
372-
throw new ClientProtocolError(String.format("Expire policies are not supported by the server " +
373-
"version %s, required version %s", protocolCtx.version(), EXPIRY_POLICY.verIntroduced()));
373+
throw new ClientFeatureNotSupportedByServerException(String.format(
374+
"Expire policies are not supported by the server version %s, required version %s",
375+
protocolCtx.version(), EXPIRY_POLICY.verIntroduced()));
374376
}
375377

376378
if (protocolCtx.isFeatureSupported(CACHE_STORAGES)) {
377379
itemWriter.accept(CfgItem.STORAGE_PATH, w -> w.writeStringArray(cfg.getStoragePaths()));
378380
itemWriter.accept(CfgItem.IDX_PATH, w -> w.writeString(cfg.getIndexPath()));
379381
}
380382
else if (!F.isEmpty(cfg.getStoragePaths()) || !F.isEmpty(cfg.getIndexPath()))
381-
throw new ClientProtocolError("Cache storages are not supported by the server");
383+
throw new ClientFeatureNotSupportedByServerException("Cache storages are not supported by the server");
382384

383385
writer.writeInt(origPos, out.position() - origPos - 4); // configuration length
384386
writer.writeInt(origPos + 4, propCnt.get()); // properties count

0 commit comments

Comments
 (0)