@Override public void insertObject(final NoSqlObject<BasicDBObject> object) { object.set("clientIP", NetUtils.getIp()); object.set("clientName", this.clientName); try { this.collection.insert(object.unwrap(), this.writeConcern); } catch (final MongoException e) { throw new AppenderLoggingException("Failed to write log event to MongoDB due to error: " + e.getMessage(), e); } }
@Override public void set(final String field, final NoSqlObject<BasicDBObject>[] values) { final BasicDBList list = new BasicDBList(); for (final NoSqlObject<BasicDBObject> value : values) { list.add(value.unwrap()); } this.mongoObject.append(field, list); }
@Override public void insertObject(NoSqlObject<Map<String, Object>> object) { BatchPoints batchPoints = BatchPoints .database(database) .retentionPolicy("default") .consistency(ConsistencyLevel.ALL) .build(); InfluxMapToSeriesConverter converter = new InfluxMapToSeriesConverter(this.seriesName, batchPoints); BatchPoints bpoints = converter.convertToBatchPoints(object.unwrap()); //TODO: did not find the udp impl of the influx-java driver. fix this for using udp. influxDB.write(bpoints); }
@Override public void insertObject(final NoSqlObject<Map<String, Object>> object) { try { client.index(object.unwrap()); } catch (Exception e) { throw new AppenderLoggingException("failed to write log event to Elasticsearch HTTP: " + e.getMessage(), e); } }
@Override public void set(final String field, final NoSqlObject<BasicDBObject> value) { this.mongoObject.append(field, value.unwrap()); }
@Override public void set(final String field, final NoSqlObject<InfluxDbNoSqlObject> value) { this.data.addItem(field, value); }
@Override public void set(String field, NoSqlObject<InfluxDbNoSqlObject>[] values) { this.data.addItem(field, values); }