thanks for replying, from looking at the logs it seems the cpu_ms and more than the api_cpu_ms. how do i turn off indexing? i haven't added any into a datastore-indexes.xml file as my object is simple and last time i tried to add an index i received a message saying it was unnecessary as it was automatically created
On Feb 20, 5:42 am, John Patterson <[email protected]> wrote: > I see about 10 times that cpu usage when loading data so that is not > unusual. I imagine most of your cpu is api_cpu? Index creation seems > to be the main culprit so turning off indexing on properties you don't > need to query on is a good start. > > On 19 Feb 2010, at 04:31, novarse wrote: > > > Hello, > > I'm trying to get data from csv files into my datastore tables. My app > > is showing cpu loadings of > > 30356ms 20023cpu_ms 11480api_cpu_ms from the dash board and I was > > wondering if someone could see how I could improve this situation. I'm > > pretty new to Java. > > > sample line from file: > > -470,16/12/2008 0:00:00,125 > > > this parses the file: > > private void processEvents(String fileName) { > > try { > > previousLineNumber = 0; > > i = 1; > > file = new File(fileName); > > CSVParser shredder = new CSVParser(new > > FileInputStream(file)); > > while ((t = shredder.nextValue()) != null) { > > if (previousLineNumber != > > shredder.getLastLineNumber()) { > > if (previousLineNumber != 0) { // save > > event > > saveData(jdoEvent); > > } > > previousLineNumber = > > shredder.getLastLineNumber(); > > i = 1; > > } else > > i++; > > switch (i) { > > case 1: > > > > jdoEvent.setPKeyEventID(Long.parseLong(t)); > > break; > > case 2: > > try { > > Date d = processDate(t); > > jdoEvent.setDate(d); > > } catch (ParseException e) { > > > > System.out.println(e.getMessage()); > > } > > break; > > case 3: > > > > jdoEvent.setFKeyRaceDescription(Long.parseLong(t)); > > break; > > } > > } > > > if (previousLineNumber != 0) { > > saveData(jdoEvent); > > } > > } catch (Exception e) { > > System.err.println(e.getMessage()); > > } > > } > > > this saves the object: > > private <J> void saveData(J jdoObject) { > > PersistenceManager pm = PMF.get().getPersistenceManager(); > > try { > > pm.makePersistent(jdoObject); > > } finally { > > pm.close(); > > } > > } > > > this is my data object: > > > package com.myproj.client; > > > import java.util.Date; > > > import javax.jdo.annotations.IdGeneratorStrategy; > > import javax.jdo.annotations.IdentityType; > > import javax.jdo.annotations.PersistenceCapable; > > import javax.jdo.annotations.Persistent; > > import javax.jdo.annotations.PrimaryKey; > > > import com.google.gwt.user.client.rpc.IsSerializable; > > > @PersistenceCapable(identityType = IdentityType.APPLICATION) > > public class JdoEvent implements IsSerializable { > > > �...@primarykey > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Long pKeyEventID; > > > �...@persistent > > private Date date; > > > �...@persistent > > private Long fKeyRaceDescription; > > > public JdoEvent() { > > > } > > > public void setDate(Date date) { > > this.date = date; > > } > > > public Date getDate() { > > return date; > > } > > > public void setPKeyEventID(Long pKeyEventID) { > > this.pKeyEventID = pKeyEventID; > > } > > > public Long getPKeyEventID() { > > return pKeyEventID; > > } > > > public void setFKeyRaceDescription(Long fKeyRaceDescription) { > > this.fKeyRaceDescription = fKeyRaceDescription; > > } > > > public Long getFKeyRaceDescription() { > > return fKeyRaceDescription; > > } > > > public String getValues() { > > return getPKeyEventID() + "; " + getFKeyRaceDescription() + "; > > " > > + getDate(); > > } > > > } > > > Thank you > > > -- > > You received this message because you are subscribed to the Google > > Groups "Google App Engine for Java" group. > > To post to this group, send email to [email protected] > > . > > To unsubscribe from this group, send email to > > [email protected] > > . > > For more options, visit this group > > athttp://groups.google.com/group/google-appengine-java?hl=en > > . -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
