Cleanup of new configuration API
by Galder Zamarreño
Hi all,
Re: https://issues.jboss.org/browse/ISPN-1745
The following deprecated methods belonging to the new configuration are going away for final and the methods that should be used instead:
- SerializationConfigurationBuilder.marshallerClass() -> SerializationConfigurationBuilder.marshaller()
- ClusteringConfigurationBuilder.stateRetrieval() -> ClusteringConfigurationBuilder.stateTransfer()
- Configuration.onePhaseCommit() -> ClusteringConfigurationBuilder.cacheMode().isSynchronous()
- StateRetrievalConfiguration -> StateTransferConfiguration
- StateRetrievalConfigurationBuilder -> StateTransferConfigurationBuilder
- TransactionConfigurationBuilder.cacheStopTimeout(int) -> TransactionConfigurationBuilder.cacheStopTimeout(long)
Other stuff I've spotted:
- TransactionConfiguration should not contain setters, those are already in TransactionConfigurationBuilder
- TransactionConfiguration.transactionalCache() has been removed
- Configuration.stateTransferEnabled was removed (what the heck was it doing there?)
If this is problematic for anyone, please reply.
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
12 years, 11 months
simulating connection timeout
by Michal Linhard
Hi all,
probably stupid question from the area of java server programming and
networking if anyone's interrested:
(otherwise sorry for spam)
is there a simple way of creating a server in java that would always
give me connection timeout ? (not connection refused, nor socket timeout
during read)
is it even possible to control establishing tcp connection from java ?
what layer does control this ?
it seems that once you bind a socket the connections are automatically
established.
probably on some JVM level ?
so when I get
java.net.ConnectException: Connection timed out
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:100)
at org.infinispan.client.hotrod.impl.transport.tcp.TcpTransport.<init>(TcpTransport.java:80)
this means that server JVM or OS networking layer or whatever was so
stressed that it didn't have time to respond with SYN,ACK flagged packet
to establish the connection ?
m.
----------- my test code:
public class EchoServer {
public static void main(String[] args) {
try {
ServerSocketChannel serverChannel = ServerSocketChannel.open();
InetSocketAddress isa = new InetSocketAddress("localhost", 9090);
serverChannel.socket().bind(isa);
Thread.sleep(20000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
public class EchoClient {
public static void main(String[] args) {
long startTime = System.currentTimeMillis();
try {
SocketAddress serverAddress = new
InetSocketAddress("localhost", 9090);
SocketChannel socketChannel = SocketChannel.open();
Socket socket = socketChannel.socket();
socket.connect(serverAddress, 5000);
socket.setSoTimeout(5000);
BufferedInputStream socketInputStream = new
BufferedInputStream(socket.getInputStream(), socket.getReceiveBufferSize());
BufferedOutputStream socketOutputStream = new
BufferedOutputStream(socket.getOutputStream(), socket.getSendBufferSize());
PrintWriter out = new PrintWriter(socketOutputStream);
out.println("Hello");
out.flush();
BufferedReader in = new BufferedReader(new
InputStreamReader(socketInputStream));
System.out.println(in.readLine());
} catch (Exception e) {
System.out.println("Exception occured after " +
(System.currentTimeMillis() - startTime) + " ms");
e.printStackTrace();
}
}
}
--
Michal Linhard
Quality Assurance Engineer
JBoss Enterprise Datagrid
Red Hat Czech s.r.o.
Purkynova 99 612 45 Brno, Czech Republic
phone: +420 532 294 320 ext. 62320
mobile: +420 728 626 363
12 years, 11 months
putForExternalRead explained
by Galder Zamarreño
Hi all,
The information on the putForExternalRead javadoc, although useful, was a bit limited, so I've extended it in a documentation section:
https://docs.jboss.org/author/x/RAY5
Please have a read and let me know what you think.
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
12 years, 11 months
Collections, immutables and copies
by Sanne Grinovero
Hi All,
after some profiling I've seen that even to manage a single command,
there is a huge amount of List<Address>, Map<Address,[something]>,
HashSet constructions involved; often they are defensively copied as
many methods might potentially remove a couple of elements, but this
event is very unlikely.
So I think the standard collections are unfit for this purpose, as
this is pretty much a constant, and also HashSets are not fit for the
purpose as most commonly they will contain a very small amount of
addresses.
I started as a draft to change this to a custom collection which would
be immutable by default and provide efficient implementations for the
specific use cases Infinispan has, and while proceeding in making more
and more changes to make it compile I convinced myself that it was the
way to go as the amount of copies and operations performed on these is
impressive, and this was going to avoid most of the work.
BUT I'm changing way more code than expected, including lots of
interfaces, and keeping deprecated copies makes it too complex.
So even if this was meant to be a draft and I didn't even finish it,
I'm aborting the task already and proposing to do something similar
for 6.0.
I can say now that it's a big work, and while I don't have performance
tests backing this I expect it to be worth it.
Sanne
12 years, 11 months
Performance improvements, more...
by Sanne Grinovero
Hello,
I just got these figures using the Transactional test:
Done 2,592,102,434 transactional operations in 62.18 minutes using
5.1.0-SNAPSHOT
2,576,372,975 reads and 15,729,459 writes
Reads / second: 690,573
Writes/ second: 4,216
which are much better than what I had 24 hours ago with 23a031e
(same test, same parameters) :
Done 878,390,104 transactional operations in 23.06 minutes using 5.1.0-SNAPSHOT
873,278,200 reads and 5,111,904 writes
Reads / second: 631,100
Writes/ second: 3,694
The main differences are our minor cleanups from yesterday and
JBMAR-127 - but this wasn't released yet, I'm depending on a locally
built snapshot.
Cheers,
Sanne
12 years, 11 months
Documentation links
by Galder Zamarreño
Guys,
>From now on, when you post links to documentation externally (blog, forum, …etc), could you please follow the suggestion in http://confluence.atlassian.com/display/DOC/Linking+to+Confluence+Pages+f... ?
This way, the wikis can be renamed/moved, if necessary, without affecting links posted externally.
I'll go through the blog posts later today to change the links there.
Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache
12 years, 11 months
XSD
by Pete Muir
All
Please don't forget to update the XSD when you update the parser!
I'm noticing quite a few programmatic configuration elements for transactions that haven't been properly added…
Pete
12 years, 11 months