Skip to content

Commit

Permalink
Doc: nit: code examples should call add() instead of addObject() on w…
Browse files Browse the repository at this point in the history
…rite state engine and object mapper
  • Loading branch information
Sunjeet committed Jun 16, 2023
1 parent 2b725e9 commit c8a735c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/advanced-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ HollowObjectWriteRecord movieRec = new HollowObjectWriteRecord(movieSchema);

titleRec.setString("value", "The Matrix");

int titleOrdinal = writeEngine.addObject("String", titleRec);
int titleOrdinal = writeEngine.add("String", titleRec);

movieRec.setLong("id", 1);
movieRec.setReference("title", titleOrdinal);
movieRec.setInt("releaseYear", 1999);

writeEngine.addObject("Movie", movieRec);
writeEngine.add("Movie", movieRec);
```

Note that referenced records must be added prior to referencing records in order to obtain the referenced ordinals.
Expand Down Expand Up @@ -314,7 +314,7 @@ List<MovieUpdateEvent> eventBatch = /// a batch of events
for(MovieUpdateEvent event : eventBatch) {
int oldOrdinal = idx.getMatchingOrdinal(event.getMovie().getId());
movieTypeState.removeOrdinalFromThisCycle(oldOrdinal);
mapper.addObject(event.getMovie());
mapper.add(event.getMovie());
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/diving-deeper.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ HollowWriteStateEngine writeEngine = new HollowWriteStateEngine();
HollowObjectMapper mapper = new HollowObjectMapper(writeEngine);

for(Movie movie : movies)
mapper.addObject(movie);
mapper.add(movie);

OutputStream os = ...; /// where to write the blob
HollowBlobWriter writer = new HollowBlobWriter(writeEngine);
Expand Down Expand Up @@ -93,7 +93,7 @@ Some time has passed and the dataset has evolved. The producer, with the same `
writeEngine.prepareForNextCycle();

for(Movie movie : movies)
mapper.addObject(movie);
mapper.add(movie);

OutputStream os = ....; /// where to write the delta blob
writer.writeDelta(os);
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ List<Movie> movies = Arrays.asList(

producer.runCycle(state -> {
for(Movie movie : movies)
state.addObject(movie);
state.add(movie);
});
```

Expand Down

0 comments on commit c8a735c

Please sign in to comment.