Skip to content

Commit

Permalink
Another sync of ElasticsearchException ids with 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Sep 25, 2015
1 parent 5571c32 commit f40ae25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ enum ElasticsearchExceptionHandle {
MAPPER_EXCEPTION(org.elasticsearch.index.mapper.MapperException.class, org.elasticsearch.index.mapper.MapperException::new, 37),
INVALID_TYPE_NAME_EXCEPTION(org.elasticsearch.indices.InvalidTypeNameException.class, org.elasticsearch.indices.InvalidTypeNameException::new, 38),
SNAPSHOT_RESTORE_EXCEPTION(org.elasticsearch.snapshots.SnapshotRestoreException.class, org.elasticsearch.snapshots.SnapshotRestoreException::new, 39),
PARSING_EXCEPTION(org.elasticsearch.common.ParsingException.class, org.elasticsearch.common.ParsingException::new, 40),
INDEX_SHARD_CLOSED_EXCEPTION(org.elasticsearch.index.shard.IndexShardClosedException.class, org.elasticsearch.index.shard.IndexShardClosedException::new, 41),
RECOVER_FILES_RECOVERY_EXCEPTION(org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException::new, 42),
TRUNCATED_TRANSLOG_EXCEPTION(org.elasticsearch.index.translog.TruncatedTranslogException.class, org.elasticsearch.index.translog.TruncatedTranslogException::new, 43),
RECOVERY_FAILED_EXCEPTION(org.elasticsearch.indices.recovery.RecoveryFailedException.class, org.elasticsearch.indices.recovery.RecoveryFailedException::new, 44),
INDEX_SHARD_RELOCATED_EXCEPTION(org.elasticsearch.index.shard.IndexShardRelocatedException.class, org.elasticsearch.index.shard.IndexShardRelocatedException::new, 45),
Expand Down Expand Up @@ -596,10 +598,8 @@ enum ElasticsearchExceptionHandle {
STRICT_DYNAMIC_MAPPING_EXCEPTION(org.elasticsearch.index.mapper.StrictDynamicMappingException.class, org.elasticsearch.index.mapper.StrictDynamicMappingException::new, 135),
RETRY_ON_REPLICA_EXCEPTION(org.elasticsearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException.class, org.elasticsearch.action.support.replication.TransportReplicationAction.RetryOnReplicaException::new, 136),
TYPE_MISSING_EXCEPTION(org.elasticsearch.indices.TypeMissingException.class, org.elasticsearch.indices.TypeMissingException::new, 137),
PARSING_EXCEPTION(org.elasticsearch.common.ParsingException.class, org.elasticsearch.common.ParsingException::new, 140),
RECOVER_FILES_RECOVERY_EXCEPTION(org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException::new, 141),
FAILED_TO_COMMIT_CLUSTER_STATE_EXCEPTION(org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException::new, 142),
QUERY_SHARD_EXCEPTION(org.elasticsearch.index.query.QueryShardException.class, org.elasticsearch.index.query.QueryShardException::new, 143);
FAILED_TO_COMMIT_CLUSTER_STATE_EXCEPTION(org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException::new, 140),
QUERY_SHARD_EXCEPTION(org.elasticsearch.index.query.QueryShardException.class, org.elasticsearch.index.query.QueryShardException::new, 141);

final Class<? extends ElasticsearchException> exceptionClass;
final FunctionThatThrowsIOException<StreamInput, ? extends ElasticsearchException> constructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ public void testParsingException() throws IOException {
ParsingException ex = serialize(new ParsingException(1, 2, "fobar", null));
assertNull(ex.getIndex());
assertEquals(ex.getMessage(), "fobar");
assertEquals(ex.getLineNumber(),1);
assertEquals(ex.getLineNumber(), 1);
assertEquals(ex.getColumnNumber(), 2);

ex = serialize(new ParsingException(1, 2, null, null));
assertNull(ex.getIndex());
assertNull(ex.getMessage());
assertEquals(ex.getLineNumber(),1);
assertEquals(ex.getLineNumber(), 1);
assertEquals(ex.getColumnNumber(), 2);
}

Expand Down Expand Up @@ -697,9 +697,9 @@ public void testIds() {
ids.put(37, org.elasticsearch.index.mapper.MapperException.class);
ids.put(38, org.elasticsearch.indices.InvalidTypeNameException.class);
ids.put(39, org.elasticsearch.snapshots.SnapshotRestoreException.class);
ids.put(40, null);
ids.put(40, org.elasticsearch.common.ParsingException.class);
ids.put(41, org.elasticsearch.index.shard.IndexShardClosedException.class);
ids.put(42, null);
ids.put(42, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class);
ids.put(43, org.elasticsearch.index.translog.TruncatedTranslogException.class);
ids.put(44, org.elasticsearch.indices.recovery.RecoveryFailedException.class);
ids.put(45, org.elasticsearch.index.shard.IndexShardRelocatedException.class);
Expand Down Expand Up @@ -797,10 +797,8 @@ public void testIds() {
ids.put(137, org.elasticsearch.indices.TypeMissingException.class);
ids.put(138, null);
ids.put(139, null);
ids.put(140, org.elasticsearch.common.ParsingException.class);
ids.put(141, org.elasticsearch.indices.recovery.RecoverFilesRecoveryException.class);
ids.put(142, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class);
ids.put(143, org.elasticsearch.index.query.QueryShardException.class);
ids.put(140, org.elasticsearch.discovery.Discovery.FailedToCommitClusterStateException.class);
ids.put(141, org.elasticsearch.index.query.QueryShardException.class);

Map<Class<? extends ElasticsearchException>, Integer> reverse = new HashMap<>();
for (Map.Entry<Integer, Class<? extends ElasticsearchException>> entry : ids.entrySet()) {
Expand Down

0 comments on commit f40ae25

Please sign in to comment.