monica singh

Greenhorn
+ Follow
since Jan 04, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by monica singh

I am trying to come up with a regular expression for the following log format.

Severity Mar 10 04:05:43 Mar 10 04:05:43 hostname Logged in to the server

Could anyone try out the same thing.
Thanks.
13 years ago
Hi Joe,

I am talkng about the same problem but a bit different one.Problem here is with the export.But ,as the problem is going in different directions ,and as per my view,questions related to IO should be in that topic,I had to raise like this.

Increasing the size of the memory is not the solution I would prefer for my application.
And reducing the heap object usage,I had done it as far as possible.
13 years ago
I have seen about this here in the following link.
https://issues.alfresco.com/jira/browse/ETHREEOH-974
13 years ago
Hi all,

How to use BufferedServletOutputStream.I had raised the same query in sun site,but did not get a reply yet.
So,hoping for some answers here.

Whats the jar file that I have to use here for this .Please let me know.Thanks.
13 years ago
There is a file in some format in some location.
eachLine is the every line that I read from the buffered reader of that file.
I read the file line by line which is a string buffer which is converted to string and write it to csv.
13 years ago
I could see that new BufferedWritter constructor doesnot take out here which is a servletoutputstream.Above thing didnot work
13 years ago
Here is how m initializing out - out = response.getOutputStream();
I shal check now with buffered writer and see whether the problem exists
13 years ago
How would I wrap a bufferedwriter here.Please help.thanks
13 years ago
Hi all,

My requirement is to export 65Mb file in a CSV format.There is no possibility for me to increase the heap size.
But ,I get the following error which is below the code while doing an export.
Whole 65mb ,I am putting into the response stream.I am not sure whether this is allowed or not.If not,please tell me the alternatives.

ServletOutputStream out = null;
final FacesContext faces = FacesContext.getCurrentInstance();
final HttpServletResponse response = (HttpServletResponse) faces
.getExternalContext().getResponse();
response.setContentType( "application/download" );
response.setHeader( ...................);
final byte[] byteArray = eachLine.toString().getBytes();
response.setContentLength( byteArray.length );
out.write(byteArray);

java.lang.OutOfMemoryError: Java heap space
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:95)
at org.apache.myfaces.webapp.filter.ExtensionsResponseWrapper$MyServletOutputStream.write(ExtensionsResponseWrapper.java:138)
at org.ajax4jsf.io.FastBufferOutputStream.writeTo(FastBufferOutputStream.java:151)
at org.ajax4jsf.framework.ajax.xmlfilter.FilterServletResponseWrapper.sendContent(FilterServletResponseWrapper.java:469)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:193)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
13 years ago
My design implementation was asked not to use pagination.So,I cannot use this.
13 years ago
Log message format :

Severity Time Generated Time Reported HostName Message

eg for the above.
info Mar 10 04:02:02 Mar 10 04:02:02 hostname message

Output on the UI should be in the format:
Time Generated Time Reported HostName Severity Message

I would be having some lakhs of records in my file.
While looping through all,I should take each log record mentioned in the first format,parse it or split it
and then display on the UI in the second format.

I am currently splitting the record using space and then looking for each thing.
In this process,I am using strings which is consuming more memory as there are so many records.

Can anyone define any pattern for this.
Please help.
13 years ago
Hi all,

I have a file to read from,say 50000 records.
I do not have any database maintained for my application.
Can i display the file data on the UI using pagination mechanism.

If so,how could I do that.
13 years ago
As Rob said,when I am using that pattern.quote,it treats as a regular character but not regex..but my search should even see for these sort of searches with case-in-sensitive thing
13 years ago
Rob,
That was a good catch.I observe that when I put that pattern.quote the result is false though :-(

String searchString = "*BC";
final Pattern searchPattern = Pattern.compile(Pattern.quote(searchString),Pattern.CASE_INSENSITIVE);
boolean searchResult = searchPattern.matcher("NFFFABC").find();
System.out.println( "result " + searchResult); - prints false

My requirement is to print that as true.
13 years ago
Yes,I could see that * is a special character.Even though I have browsed through,I am not able to reach to a particular solution for the mentioned search scenario.
13 years ago