sparqlGraphLibrary/src/main/java/com/ge/research/semtk/sparqlX/asynchronousQuery/AsynchronousNodeGroupBasedQueryDispatcher.java
protected void sendResultsToService(Table resTable) throws ConnectException, EndpointNotFoundException, Exception{
				
		HashMap<String, Integer> colInstCounter = new HashMap<String, Integer>();
			
		try{
			
			// repair column headers in the event that a duplicate header is encountered. by convention (established and existing only here), the first instance of a column name 
			// will remain unchanged, all future instances will be postfixed with "[X]" where X is the count encountered so far. this count will start at 1. 
			
			String[] unModColnames = resTable.getColumnNames(); 	// pre-modification column names
			String[] modColnames = new String[unModColnames.length];
			
			int posCount = 0;
			for(String uCol : unModColnames){
				if(colInstCounter.containsKey( uCol.toLowerCase() )){
					// seen this one already. update the counter and add it to the new header list.
					int update = colInstCounter.get( uCol.toLowerCase() ) + 1;
					colInstCounter.put( uCol.toLowerCase() , update);
					
					modColnames[posCount] = uCol + "[" + update + "]";
				}
				else{
					// never seen this column.
					modColnames[posCount] = uCol;
					// add to the hash
					colInstCounter.put( uCol.toLowerCase(), 0 );
				}
				
				posCount+=1;
			}
			resTable.replaceColumnNames(modColnames);
			
			(new ResultsClient(this.resConfig)).execStoreTableResults(this.jobID, resTable);
		}
		catch(Exception e){
			this.jobTracker.setJobFailure(this.jobID, "Failed to write results: " + e.getMessage());
			LocalLogger.printStackTrace(e);
			throw new Exception("Unable to write results", e);
		}
	}
/**
	 * Send the results to the results service. 
	 * @return true/false about whether the results were likely sent
	 */
Send the results to the results service.
@return true/false about whether the results were likely sent
Send the results to the results service . @return true / false about whether the results were likely sent
protected void sendResultsToService(Table resTable) throws ConnectException, EndpointNotFoundException, Exception{
		HashMap<String, Integer> colInstCounter = new HashMap<String, Integer>();
		try{
			String[] unModColnames = resTable.getColumnNames(); 	
			String[] modColnames = new String[unModColnames.length];
			int posCount = 0;
			for(String uCol : unModColnames){
				if(colInstCounter.containsKey( uCol.toLowerCase() )){
					int update = colInstCounter.get( uCol.toLowerCase() ) + 1;
					colInstCounter.put( uCol.toLowerCase() , update);
					modColnames[posCount] = uCol + "[" + update + "]";
				}
				else{
					modColnames[posCount] = uCol;
					colInstCounter.put( uCol.toLowerCase(), 0 );
				}
				posCount+=1;
			}
			resTable.replaceColumnNames(modColnames);
			(new ResultsClient(this.resConfig)).execStoreTableResults(this.jobID, resTable);
		}
		catch(Exception e){
			this.jobTracker.setJobFailure(this.jobID, "Failed to write results: " + e.getMessage());
			LocalLogger.printStackTrace(e);
			throw new Exception("Unable to write results", e);
		}
	}
protected void sendResultsToService ( Table resTable ) throws ConnectException , EndpointNotFoundException , Exception { HashMap < String , Integer > colInstCounter = new HashMap < String , Integer > ( ) ; try { String [ ] unModColnames = resTable . getColumnNames ( ) ; String [ ] modColnames = new String [ unModColnames . length ] ; int posCount = 0 ; for ( String uCol : unModColnames ) { if ( colInstCounter . containsKey ( uCol . toLowerCase ( ) ) ) { int update = colInstCounter . get ( uCol . toLowerCase ( ) ) + 1 ; colInstCounter . put ( uCol . toLowerCase ( ) , update ) ; modColnames [ posCount ] = uCol + "[" + update + "]" ; } else { modColnames [ posCount ] = uCol ; colInstCounter . put ( uCol . toLowerCase ( ) , 0 ) ; } posCount += 1 ; } resTable . replaceColumnNames ( modColnames ) ; ( new ResultsClient ( this . resConfig ) ) . execStoreTableResults ( this . jobID , resTable ) ; } catch ( Exception e ) { this . jobTracker . setJobFailure ( this . jobID , "Failed to write results: " + e . getMessage ( ) ) ; LocalLogger . printStackTrace ( e ) ; throw new Exception ( "Unable to write results" , e ) ; } }
Send the results to the results service.
Send the results to the results service .
// repair column headers in the event that a duplicate header is encountered. by convention (established and existing only here), the first instance of a column name  // will remain unchanged, all future instances will be postfixed with "[X]" where X is the count encountered so far. this count will start at 1.  // pre-modification column names // seen this one already. update the counter and add it to the new header list. // never seen this column. // add to the hash