Quantcast
Channel: User user1944408 - Stack Overflow
Browsing all 26 articles
Browse latest View live
↧

Comment by user1944408 on Java Class.cast() vs. cast operator

I also use the second variant when I need Class<T> cls to be dynamic, for example if I use reflection but in all other cases I prefer the first one. Well I guess that's just a personal taste.

View Article


Comment by user1944408 on Do a IN in stored procedure with variable

That is risky because of SQL Injection.

View Article


Comment by user1944408 on Why shouldn't Java enum literals be able to have...

But then you could not do assignment like this MyEnum<Int> blabla = valueOf("some double property"); because the types are not compatible. Also you want in that case to get null because you want...

View Article

Comment by user1944408 on Why C# implements methods as non-virtual by default?

You said: "Having methods virtual by default means that every function in the class can be plugged out and replaced by another, which is not really a good thing." Why?

View Article

Comment by user1944408 on Thread-safe setting of a variable (Java)?

@Stephen: Check the source for String hashCode(). You will find hash=h which is considered thread safe without hash being volatile.

View Article


Comment by user1944408 on Should we @Override an interface's method...

This is not an answer to the question. Object is not an interface.

View Article

Comment by user1944408 on How to clean up ThreadLocals

Even if you use static ThreadLocal you can have a class loader leak when you redeploy your webapp if your value refer to some class loaded by the same class loader. It can happen if you use double...

View Article

Comment by user1944408 on ThreadLocal & Memory Leak

Sometimes people use a custom class in threadLocal value without even realizing that. For example it can happen when you use double brace initialization for your thread local value because double brace...

View Article


Comment by user1944408 on When and how should I use a ThreadLocal variable?

Just be careful not to use double brace initialization for your SimpleDateFormat because that would create an anonymous class so your class loader could not be garbage collected. memory leak: return...

View Article


Comment by user1944408 on How to identify and remove Threads/ThreadLocals...

If you use static ThreadLocal you will not have memory leak overtime but you will have a memory leak on stop/redeploy.

View Article

Comment by user1944408 on Why is Collections.unmodifiableList not defined to...

@khelwood Of course it would not prevent runtime exceptions in all cases but it will catch more bugs in compile time.

View Article

Answer by user1944408 for Eventualy consistent distributed database with...

Ok, I see that problem 2 has been resolved in cassandra https://issues.apache.org/jira/browse/CASSANDRA-1072Distributed counters will combine increase operations so everything will be consistent at the...

View Article

Eventualy consistent distributed database with idempotent increase operator?

Is there a distributed high availability, eventually consistent db that supports idempotent operation on scalar values?If we use normal updates then there is a possibility that we will have 2 different...

View Article


Can I have rows ordered by key and partitioned randomly?

For example if I process a lot of transactions [timestamp (key), value, trader,..] I would like to have random partitioning for the sake of load balancing. But for the sake of queries I would like...

View Article

Will cassandra support secondary indices which contain additional attributes...

Is there a possibility for a secondary index to contain another attributes beside key values? For example transaction key and transaction amount. In that way I could calculate everything I need by just...

View Article


Impact of consistency level on performance

Is there a benchmark which shows the difference in write throughput when consistency level is ONE vs LOCAL_QUORUM? In both cases RF should be the same (e.g. RF=3)?P.S. I'm not interested in latency,...

View Article

Get list of keys where column equals some value?

If I have secondary index on column STATUS I would like to get all keys (within some range) that have STATUS='processed'. How can I do that without reading any columns? I just need the list of keys so...

View Article


Consistency strategy for two datacenters

What is the best write/read strategy that is fault tolerant and fast for reads when all nodes are up?I have 2 replicas in each datacenter and at first I was considering using QUORUM for writes and...

View Article

Answer by user1944408 for Atomically updating shared state in Cassandra

As Richard pointed out the best way at the moment is to use atomic batches where you update many deltas. If something goes wrong just replay the batch.The other possible solution is to use ZooKeeper as...

View Article

Answer by user1944408 for Oracle stored procedure using array as parameter...

insert into mytable(Name, phone)select name, phonefrom TABLE(v_my_data);

View Article
Browsing all 26 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>