You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Naveen <na...@gmail.com> on 2018/03/23 08:50:09 UTC
Error: class org.apache.ignite.IgniteException: Ignite instance
with this name has already been started: igniteDual
Hi
I am trying to load data from CSV to ignite thru DataStreamer
To improve the efficiency, I have started a new thread for each CSV file I
am loading,
Here is the code snippet I am using
Ignite ignite = Ignition.start("igniteDual-client.xml");
try (IgniteCache<String, AssociatedParties> testEntCache =
ignite.cache(Constants.ASSOCIATED_PARTIES)) {
try (IgniteDataStreamer<String, AssociatedParties> streamer =
ignite.dataStreamer(Constants.ASSOCIATED_PARTIES)) {
streamer.allowOverwrite(Constants.allowOverwrite);
FileInputStream inputStream = null;
Scanner sc = null;
inputStream = new FileInputStream(fileName);
sc = new Scanner(inputStream, "UTF-8");
while (sc.hasNextLine()) {
String line = sc.nextLine();
String[] tokens = line.split(Constants.Delimter, -1);
aAssociatedParties.setAssociatedPartyId(tokens[1]);
aAssociatedParties.setUpdatedby(tokens[3]);
aAssociatedParties.setUpdateddatetime(new
Timestamp(System.currentTimeMillis()));
streamer.perNodeBufferSize(Constants.perNodeBufferSize);
streamer.perNodeParallelOperations(Constants.perNodeParallelOperations);
streamer.addData(tokens[0], aAssociatedParties);
}
}
Basically i am using the same ignite config XML for loading.
IN this case, there are 2 files I am trying to load and using the same
config file (attached the config xml as well.
This is the error I am getting
"class org.apache.ignite.IgniteException: Ignite instance with this name has
already been started: igniteDual"
How can i use unique name for every client, when I omit the instance name
also its throwing error saying the default instance is already connected.
Thanks
Naveen
igniteDual-client.xml
<http://apache-ignite-users.70518.x6.nabble.com/file/t1478/igniteDual-client.xml>
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Error: class org.apache.ignite.IgniteException: Ignite instance
with this name has already been started: igniteDual
Posted by Evgenii Zhuravlev <e....@gmail.com>.
>datastreamer which has all the configurations/properties per client basis.
what do you mean? Why do you think so?
It's definitely wrong to create a new client per thread, it creates a huge
needless overhead.
Evgenii
2018-03-29 8:28 GMT+03:00 Naveen <na...@gmail.com>:
> The reason I was creating a new client for every thread is I am using
> datastreamer which has all the configurations/properties per client basis.
> Thats why I am using a new client for each thread, it was working fine when
> I used native persistence alone, now with this config XML which is used for
> dual backing store - native and Oracle, which is failing in this case.
>
> Thanks
> naveen
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
Re: Error: class org.apache.ignite.IgniteException: Ignite instance
with this name has already been started: igniteDual
Posted by Naveen <na...@gmail.com>.
The reason I was creating a new client for every thread is I am using
datastreamer which has all the configurations/properties per client basis.
Thats why I am using a new client for each thread, it was working fine when
I used native persistence alone, now with this config XML which is used for
dual backing store - native and Oracle, which is failing in this case.
Thanks
naveen
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Error: class org.apache.ignite.IgniteException: Ignite instance
with this name has already been started: igniteDual
Posted by Evgenii Zhuravlev <e....@gmail.com>.
You definitely don't need to start a new clients per thread for this
2018-03-23 13:04 GMT+03:00 Naveen <na...@gmail.com>:
> I dont have ant specific requirement to start several nodes in a single JVM
>
> I have set of CSV files in a directory, for each file I want to create a
> new
> thread which connects to the ignite cluster with the config XML and start
> reading the data from the CSV and load it to ignite with datastreamer.
>
> Thanks
> Naveen
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
Re: Error: class org.apache.ignite.IgniteException: Ignite instance
with this name has already been started: igniteDual
Posted by Naveen <na...@gmail.com>.
I dont have ant specific requirement to start several nodes in a single JVM
I have set of CSV files in a directory, for each file I want to create a new
thread which connects to the ignite cluster with the config XML and start
reading the data from the CSV and load it to ignite with datastreamer.
Thanks
Naveen
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Error: class org.apache.ignite.IgniteException: Ignite instance
with this name has already been started: igniteDual
Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi Naveen,
It looks like you trying to start several Ignite nodes inside one JVM, why
do you want it?
Regards,
Evgenii
2018-03-23 11:50 GMT+03:00 Naveen <na...@gmail.com>:
> Hi
>
> I am trying to load data from CSV to ignite thru DataStreamer
>
> To improve the efficiency, I have started a new thread for each CSV file I
> am loading,
>
> Here is the code snippet I am using
>
> Ignite ignite = Ignition.start("igniteDual-client.xml");
> try (IgniteCache<String, AssociatedParties> testEntCache =
> ignite.cache(Constants.ASSOCIATED_PARTIES)) {
>
> try (IgniteDataStreamer<String, AssociatedParties> streamer =
> ignite.dataStreamer(Constants.ASSOCIATED_PARTIES)) {
> streamer.allowOverwrite(Constants.allowOverwrite);
>
> FileInputStream inputStream = null;
> Scanner sc = null;
> inputStream = new FileInputStream(fileName);
> sc = new Scanner(inputStream, "UTF-8");
> while (sc.hasNextLine()) {
> String line = sc.nextLine();
> String[] tokens = line.split(Constants.Delimter,
> -1);
> aAssociatedParties.setAssociatedPartyId(tokens[1]
> );
> aAssociatedParties.setUpdatedby(tokens[3]);
> aAssociatedParties.setUpdateddatetime(new
> Timestamp(System.currentTimeMillis()));
>
> streamer.perNodeBufferSize(
> Constants.perNodeBufferSize);
> streamer.perNodeParallelOperations(Constants.
> perNodeParallelOperations);
>
> streamer.addData(tokens[0], aAssociatedParties);
> }
> }
>
> Basically i am using the same ignite config XML for loading.
> IN this case, there are 2 files I am trying to load and using the same
> config file (attached the config xml as well.
>
> This is the error I am getting
> "class org.apache.ignite.IgniteException: Ignite instance with this name
> has
> already been started: igniteDual"
>
> How can i use unique name for every client, when I omit the instance name
> also its throwing error saying the default instance is already connected.
>
> Thanks
> Naveen
> igniteDual-client.xml
> <http://apache-ignite-users.70518.x6.nabble.com/file/
> t1478/igniteDual-client.xml>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>