Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I understand we can do this with file input and output, but why would we want to do this?
It is simply called persistence.
You nailed it: you want to be able to store information (for example after intensive computations) in a way that survives the lifetime of the current JVM process.
In that sense serialization is a (poor) version of database storage.
But of course, that comment is correct: this does not prevent the creation of objects. It is a mechanism to resurrect previous state into "new" objects.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
What is the difference between Collectors & Collector. I know that one is interface & one is class. I want to know with example what is the actual difference and When to use which one with real time example.
Hi all I already mentioned in my question I know the basic difference and I gone through the documentation also, I just want to know the purpose to introduce this two thing with example and When should use which one?
Collectors is just a class with static methods which create commonly used Collectors.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm converting a flow from straight single thread, to use a batch processor. So, I'm converting most of the flow variables to recordVars. Some questions i can't find in the docs:
How do i access a record var in a java transformer? I'm used to message.getInvocationProperty for flow vars
What happens when i change a flow var - can other threads in the batch see the changes?
You can access recordVars form Java or Groovy component using the following:
import com.mulesoft.module.batch.record.BatchUtils;
...
BatchUtils.getRecord(message).getVariable('myVar');
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
what is the best type to store data from csv format file, where is 150k records(lines) where each line has 9 columns(fields). After initialize my type with these data i need to do some operations on it, like add record in specified line, or add/change some data in some field. Also i need to compare data between themselves. Thank for help!
The best type to use is an ArrayList of a domain object. The domain object has 9 properties.
In other words: don't make it generic, make it specific for your problem. Then your code will be more readable and type-safety helps you when you create the functionality.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
There are several methods to create Instance in Java
(Different ways are new operator, cloning, reflection and DE-serialization etc)
So among them which is the fastest of all ?
In such a case fastest means which one of those executes less operations before actually allocating the memory for the object. It is easy to determine that new is the fastest among those because it doesn't bear the overhead created from the others such as clone etc.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am looking to create a custom EventProcessors in Disruptor but the documentation is very minimal. (https://code.google.com/p/disruptor/wiki/DisruptorWizard) How is this done. What are the concepts behind it and what are the issues and pitfalls?
Your question is very broad, so is my answer.
the concept behind the event processor is that it processes one event at a time in a single thread.
the issue is that you must decompose you system into asynchronous events.
pitfalls: it may be much more complicated than you need unless you really need millions of events per second. (And this is pretty rare out side HFT)