xeon costa

Greenhorn
+ Follow
since May 10, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by xeon costa

I am using a program that transfer files between the hosts. My problem is that the network between these hosts have a high latency (> 1sec), and sometimes my programs launch a error of "java.net.NoRouteToHostException: No route to host; ".

I think this problem happens because of the latency. There is a way to configure the JVM for networks with high latency so that the time to try to connect to a remote host is longer?

Thanks,
In a Linux OS, when a program get the IP address with "getHostAddress()". it gets the first IP address available.
In a host with 2 interfaces, eth0 and eth1, the method will get the eth0 IP address by default.

I have a host that is behind a NAT, and I cannot change the host IP addresses, or the order of the interfaces.
In the host, eth0 is a private address, and in eth1 is an address that NAT knows.
If I want to reach the host from outside, I connect to an IP that NAT will translate into the address of eth1.

I need to use the private IP address to run a java service (Hadoop MapReduce) correctly, and not the eth1 address.
I tried to set Hadoop with the eth1 address but the service won't run giving me a not allowed exception.

1 - Now I want to contact the Hadoop service that is running behind the NAT from the internet, and the service is registered with the private address. Is it possible to reach that node?

2 - If I could bind eth1 to the java service, I could reach the host from outside?

3 - If I could update the NAT table with the private address of the host, I could already reach the host from outside?


10 years ago
I've a java file that declares a class and an inner class. Both classes must log to distinct log files. 'A' class must log to A.log and 'B' must log to B.log. How can I set these classes to the respective appenders?

Below are the files:




12 years ago
Hi,

I use jstack PID command on my program in java and I got this output.



At one line, I've got " - locked <0x00007f5668a910c0> (a java.util.ArrayList)". I'd like to know what this hexadecimal address points to, to know which arraylist is . Is this possible?

Thanks,
13 years ago
Hi,

I've a java platform made by myself that offers a multicast communication. This platform is running in daemon and if a user want to send some multicast message, just have to call the interface method send(String group, Message m), and the platform will deliver the message to the group. There is some configuration files saved locally that is where the groups are specified. The user can't update the configuration files, only the admin user can do that.

For example, the admin user defined Group1, that includes Host1, Host2 and Host4. Group2 includes Host2 and Host3. If the user want to send the message to Group1, just has to call the method like this:


I would like to use java access control to allow only the admin user access these configuration files. Other users can't read or write to these files.

How can I do this using the Java Security platform?

Thanks,
13 years ago
Hi,

I want to debug remotely a java application, but the application is running behind 3 machines. Here's the layout of the machines:


My PC --> machine 1 --> machine 2 --> my application.

The only way to access to the application is with ssh. How do I set an ssh tunnel to remote debug the application?
13 years ago
Synchronization is an issue.
13 years ago
Hi,

I've an ArrayList of Obejcts, and I would like to remove a subset of Objects at once. The problem is that, when I iterate over an Arraylist, and I remove an Object, the other objects are reallocated, and son it's impossible to remove a subset of objects at once. Each Object contains a id.

Here's an example:

I've a list with Objects:
List {Obj1, Obj2, Obj3, Obj4, Obj5}.

And now I would like to remove Obj2 and Obj5 at once.

Probably the ArrayList is not the best Collection to do that, but what other collection should I use?


13 years ago
Hi,

I'm running a java application in a remote site, and I would like to debug the application. I'm using jdb, and, due to network architecture, I can only use jdb do debug in text-mode.

To debug in text-mode I use the command:
jdb -attach remotesite:port.

At this point this is ok. Now I would like to attach the source code to the jdb. I tried the command
jdb -attach remotesite:port ~/src/org/path/file.java

to attach the source code to the remote debug to. But it doesn't work.

In jdb, I try the command
use ~/src/org/path/file.java

but it doesn't work either.

How can I attach the source code to the remote debug?

Thanks,
PSC
13 years ago
I understand your point. Thank you for your explanation.
13 years ago
If I start to talk about the amount of messages that each switched through all components. Is it a useful performance metric?

Is there any other performance metric?
13 years ago
I see that each components takes about 70% of the CPU in each node. I don't understand if this is related to the data that he's processing, or it's because of something wrong in the code, like deadlock, or infinite whiles. The application takes 30 minutes to process 1GB of data through all the cluster.

Is this a good a point to start to improve the performance of an application?
13 years ago
Hi,

I've a distributed application made in java that runs in a clustering system. This application is composed by several components. Each component run on each node of the cluster. The components exchanges messages using HTTP protocol and RPC invocations. The cluster is composed by several linux machines and it doesn't use X11. I'm doing some performance tests to see if I can improve the performance of my application.

For that, I'm trying to see how many memory the application uses, or if it exists loops or deadlocks, using top command. I'm also looking to the messages exchanged using the tcpdump command, to see if I can reduce the number of messages exchanged between the components. I've also made a static code analysis using the PMD and findbugs application to find possible errors, or deadlocks.

In overall, I trying to do all the possible tests to see if my application doesn't consume plenty of resources (CPU, memory, ...) and if it's possible to improve its performance.

1 - But, I don't have too much experience in analysing the behaviour of an application using the top or the tcpdump. Can anyone give me an advice on how to debug programs using top and tcpdump?

2 - Is there any good manual that explains how to debug programs?

3- Is there any other tool beside PMD and findbugs to make static code analysis, or any other type of analyses?


Thanks
13 years ago
Yes Chinna Eranna, this is the problem.

The problem is that I haven't really understand the synchronized(...){...} block. I thought that putting synchronized(tips) {...}, would say that when a thread is inside this point, the object could not be updated in any other part of the code. But, this is not true. So, I think that the solution is to use a synchronized object.

Is there any other solutions for this case?
Hi,

I'm iterating an Arraylist inside a synchronized method, and I've set the Arraylist synchronized inside the method, but I still got the error ConcurrentModificationException. Why this is happening?