diff --git a/pom.xml b/pom.xml index a6c801a..87dec48 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ Analytics Cloud Datatset Utils datasetutils jar - 32.0.22-SNAPSHOT + 32.0.23-SNAPSHOT https://github.com/forcedotcom/Analytics-Cloud-Dataset-Utils salesforce.com @@ -14,7 +14,7 @@ 32.0.0 - 1.6 + 1.7 UTF-8 @@ -119,12 +119,12 @@ org.eclipse.jetty jetty-server - 9.2.6.v20141205 + 9.2.10.v20150310 org.eclipse.jetty jetty-webapp - 9.2.6.v20141205 + 9.2.10.v20150310 diff --git a/src/main/java/com/sforce/dataset/loader/file/schema/ext/DetectFieldTypes.java b/src/main/java/com/sforce/dataset/loader/file/schema/ext/DetectFieldTypes.java index c21a905..773673f 100644 --- a/src/main/java/com/sforce/dataset/loader/file/schema/ext/DetectFieldTypes.java +++ b/src/main/java/com/sforce/dataset/loader/file/schema/ext/DetectFieldTypes.java @@ -267,8 +267,7 @@ public BigDecimal detectNumeric(LinkedList columnValues) { BigDecimal maxScale = null; BigDecimal maxPrecision = null; - @SuppressWarnings("unused") - int failures = 0; + int consectiveFailures = 0; int success = 0; int absoluteMaxScale = 6; int absoluteMaxScaleExceededCount = 0; @@ -303,10 +302,14 @@ public BigDecimal detectNumeric(LinkedList columnValues) maxPrecision = bd; success++; + consectiveFailures=0; //reset the failure count }catch(Throwable t) { - failures++; + consectiveFailures++; } + + if(consectiveFailures>=1000) + return null; } if(maxScale==null || maxPrecision==null) @@ -388,8 +391,7 @@ public SimpleDateFormat detectDate(LinkedList columnValues) if(dt!=null) { - @SuppressWarnings("unused") - int failures = 0; + int consectiveFailures = 0; int success = 0; for(int k=0;k columnValues) String tmpDate = dtf.format(dt1); if(tmpDate.length() == columnValue.length()) { - success++; + success++; + consectiveFailures=0; //reset the failure count } } catch (ParseException e) { - failures++; - } + consectiveFailures++; + } + + if(consectiveFailures>=1000) + break; } - if((1.0*success/columnValues.size()) > 0.95) + if(!(consectiveFailures>=1000) && (1.0*success/columnValues.size()) > 0.95) { return dtf; }else diff --git a/src/main/java/com/sforce/dataset/server/DatasetUtilServer.java b/src/main/java/com/sforce/dataset/server/DatasetUtilServer.java index 687ed5e..bebf63d 100644 --- a/src/main/java/com/sforce/dataset/server/DatasetUtilServer.java +++ b/src/main/java/com/sforce/dataset/server/DatasetUtilServer.java @@ -59,7 +59,7 @@ public static void main(String[] args) throws Exception { public void init(String[] args, boolean join) throws Exception { // DatasetUtilServer.partnerConnection = partnerConnection; - final String WEBAPPDIR = "index.html"; + final String WEBAPPDIR = "login.html"; final String contextPath = "/"; final int maxFormContentSize = 40 * 1000 * 1024 * 1024; @@ -72,13 +72,14 @@ public void init(String[] args, boolean join) throws Exception { final URL warUrl = this.getClass().getClassLoader().getResource(WEBAPPDIR); String warUrlString = "src/main/webapp"; + System.out.println("warUrl:"+warUrlString); if(warUrl!=null) { warUrlString = warUrl.toExternalForm(); -// System.out.println("warUrlString:"+warUrlString); + System.out.println("warUrlString:"+warUrlString); warUrlString = warUrlString.replace(WEBAPPDIR, ""); } -// System.out.println("warUrlString:"+warUrlString); + System.out.println("warUrlString:"+warUrlString); WebAppContext context = new WebAppContext(warUrlString, contextPath); context.setMaxFormContentSize(maxFormContentSize); server.setHandler(context);