Skip to content

Cleanup random stats serialization code#22223

Merged
s1monw merged 5 commits intoelastic:masterfrom
s1monw:fix_stats
Dec 17, 2016
Merged

Cleanup random stats serialization code#22223
s1monw merged 5 commits intoelastic:masterfrom
s1monw:fix_stats

Conversation

@s1monw
Copy link
Copy Markdown
Contributor

@s1monw s1monw commented Dec 16, 2016

Some of our stats serialization code duplicates complicated serialization logic
or could use existing building blocks from StreamOutput/Input. This commit
cleans up some of the serialization code.

Some of our stats serializatoin code duplicates complicated seriazliation logic
or could use existing building blocks from StreamOutput/Input. This commit
cleans up some of the serialization code.
Copy link
Copy Markdown
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice cleanup.

docs, store, indexing, get, search, merge, refresh, flush, warmer, queryCache,
fieldData, completion, segments, translog, requestCache, recoveryStats})
.filter(Objects::nonNull);
for (ToXContent toXContent : stream::iterator) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this can compile?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does for me

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would require a cast though, what am I missing?

static final String MEMORY_SIZE = "memory_size";
static final String MEMORY_SIZE_IN_BYTES = "memory_size_in_bytes";
static final String EVICTIONS = "evictions";
static final String FIELDS = "fields";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can all of these fields be private?

package org.elasticsearch.index.fielddata;

import com.carrotsearch.hppc.ObjectLongHashMap;
import com.carrotsearch.hppc.cursors.ObjectLongCursor;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports can be dropped now?

@s1monw
Copy link
Copy Markdown
Contributor Author

s1monw commented Dec 16, 2016

@elasticmachine test this please

@s1monw s1monw merged commit 0b338bf into elastic:master Dec 17, 2016
@s1monw s1monw deleted the fix_stats branch December 17, 2016 10:46
s1monw added a commit that referenced this pull request Dec 17, 2016
Some of our stats serialization code duplicates complicated seriazliation logic
or could use existing building blocks from StreamOutput/Input. This commit
cleans up some of the serialization code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants