docs: @Override
  	public void doWrite(Server server, Query query, Iterable<Result> results) throws Exception {
  		// Creates only if it doesn't already exist
  		if (createDatabase) influxDB.createDatabase(database);
  		BatchPoints.Builder batchPointsBuilder = BatchPoints.database(database).retentionPolicy(retentionPolicy)
  				.tag(TAG_HOSTNAME, server.getSource());
  
  		for(Map.Entry<String,String> tag : tags.entrySet()) {
  			batchPointsBuilder.tag(tag.getKey(),tag.getValue());
  		}
  
  		BatchPoints batchPoints = batchPointsBuilder.consistency(writeConsistency).build();
  		
  		ImmutableList<String> typeNamesParam = null;
  		// if not typeNamesAsTag, we concat typeName in values.
  		if (!typeNamesAsTags) {
  			typeNamesParam = this.typeNames;
  		}
  		
  		for (Result result : results) {
  			log.debug("Query result: {}", result);
  
  			HashMap<String, Object> filteredValues = newHashMap();
  			Object value = result.getValue();
  
  			String key = KeyUtils.getPrefixedKeyString(query, result, typeNamesParam);
  			if (isValidNumber(value) || allowStringValues && value instanceof String) {
  				filteredValues.put(key, value);
  			}
  
  			// send the point if filteredValues isn't empty
  			if (!filteredValues.isEmpty()) {
  				Map<String, String> resultTagsToApply = buildResultTagMap(result);
  				if (reportJmxPortAsTag) {
  					resultTagsToApply.put(JMX_PORT_KEY, server.getPort());
  				} else {
  					filteredValues.put(JMX_PORT_KEY, Integer.parseInt(server.getPort()));
  				}
  				Point point = Point.measurement(result.getKeyAlias()).time(result.getEpoch(), MILLISECONDS)
  						.tag(resultTagsToApply).fields(filteredValues).build();
  
  				log.debug("Point: {}", point);
  				batchPoints.point(point);
  			}
  		}
  
  		influxDB.write(batchPoints);
  	}