Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues with HazelcastClient config #7289

Closed
dsukhoroslov opened this issue Jan 11, 2016 · 4 comments
Closed

issues with HazelcastClient config #7289

dsukhoroslov opened this issue Jan 11, 2016 · 4 comments

Comments

@dsukhoroslov
Copy link
Contributor

@dsukhoroslov dsukhoroslov commented Jan 11, 2016

HZ 3.5.4

  1. there is no way to set HazelcastClient Name and/or InstanceName programmatically. So, the HazelcastClient.getHazelcastClientByName(String name) method does not work.
  2. When I trying to achieve the same functionality via group name:
        for (HazelcastInstance hz: HazelcastClient.getAllHazelcastClients()) {
            if (name.equals(hz.getConfig().getGroupConfig().getName())) {
                hzClient = hz;
                break;
            }
        }

then it throws an exception:

java.lang.UnsupportedOperationException: Client cannot access cluster config!
     at com.hazelcast.client.impl.HazelcastClientInstanceImpl.getConfig(HazelcastClientInstanceImpl.java:278) ~[hazelcast-all-3.5.4.jar:3.5.4]
     at com.hazelcast.client.impl.HazelcastClientProxy.getConfig(HazelcastClientProxy.java:78) ~[hazelcast-all-3.5.4.jar:3.5.4]
     at com.bagri.xdm.cache.hazelcast.util.HazelcastUtils.getHazelcastClientByName(HazelcastUtils.java:90) ~[classes/:na]
     at com.bagri.xdm.cache.hazelcast.management.SchemaManager.setClientContext(SchemaManager.java:89) ~[classes/:na]
     at com.bagri.xdm.cache.hazelcast.management.SchemaManagement.initSchema(SchemaManagement.java:205) [classes/:na]
     at com.bagri.xdm.cache.hazelcast.management.SchemaManagement.initMember(SchemaManagement.java:316) [classes/:na]
     at com.bagri.xdm.cache.hazelcast.task.schema.SchemaAdministrator.call(SchemaAdministrator.java:64) [classes/:na]
     at com.bagri.xdm.cache.hazelcast.task.schema.SchemaAdministrator.call(SchemaAdministrator.java:23) [classes/:na]
     at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_76]
     at com.hazelcast.executor.impl.DistributedExecutorService$CallableProcessor.run(DistributedExecutorService.java:202) [hazelcast-all-3.5.4.jar:3.5.4]
     at com.hazelcast.util.executor.CachedExecutorServiceDelegate$Worker.run(CachedExecutorServiceDelegate.java:209) [hazelcast-all-3.5.4.jar:3.5.4]
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_76]
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_76]
     at java.lang.Thread.run(Thread.java:745) [na:1.7.0_76]
     at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:76) [hazelcast-all-3.5.4.jar:3.5.4]
     at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:92) [hazelcast-all-3.5.4.jar:3.5.4]
@jerrinot jerrinot added the Team: Core label Jan 18, 2016
@jerrinot jerrinot added this to the Backlog milestone Jan 18, 2016
@jerrinot jerrinot added Team: Client and removed Team: Core labels Jan 18, 2016
@jerrinot
Copy link
Contributor

@jerrinot jerrinot commented Jan 18, 2016

Hello,

thank you for reporting this issue. It seems like a weakness of client implementation.

@rajavikram
Copy link

@rajavikram rajavikram commented Jul 4, 2017

@jerrinot Any, ETA on a fix for this.

@mehmetsunkur
Copy link

@mehmetsunkur mehmetsunkur commented Jan 8, 2018

Hello,
It seems this issue fixed. You can check HazelcastClientInstanceImpl in master,maintenance-3.x branches.

public Config getConfig() {
        throw new UnsupportedOperationException("Client cannot access cluster config!");
}

method changed to

@Override
public Config getConfig() {
        return new ClientDynamicClusterConfig(this);
}
@mmedenjak mmedenjak modified the milestones: Backlog, 3.10 Jan 8, 2018
@sancar
Copy link
Member

@sancar sancar commented Jan 17, 2018

Fixed by #5605 in 3.6 .

@sancar sancar closed this Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.