Commit cb5f3d40 by Suma Shivaprasad

Fixed dependent classes related to retrieving types by Category

parent 6b744bc2
...@@ -34,11 +34,7 @@ import org.apache.hadoop.metadata.typesystem.TypesDef; ...@@ -34,11 +34,7 @@ import org.apache.hadoop.metadata.typesystem.TypesDef;
import org.apache.hadoop.metadata.typesystem.json.InstanceSerialization; import org.apache.hadoop.metadata.typesystem.json.InstanceSerialization;
import org.apache.hadoop.metadata.typesystem.json.Serialization$; import org.apache.hadoop.metadata.typesystem.json.Serialization$;
import org.apache.hadoop.metadata.typesystem.json.TypesSerialization; import org.apache.hadoop.metadata.typesystem.json.TypesSerialization;
import org.apache.hadoop.metadata.typesystem.types.ClassType; import org.apache.hadoop.metadata.typesystem.types.*;
import org.apache.hadoop.metadata.typesystem.types.IDataType;
import org.apache.hadoop.metadata.typesystem.types.Multiplicity;
import org.apache.hadoop.metadata.typesystem.types.TraitType;
import org.apache.hadoop.metadata.typesystem.types.TypeSystem;
import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -144,8 +140,8 @@ public class DefaultMetadataService implements MetadataService { ...@@ -144,8 +140,8 @@ public class DefaultMetadataService implements MetadataService {
* @return list of trait type names in the type system * @return list of trait type names in the type system
*/ */
@Override @Override
public List<String> getTraitNamesList() throws MetadataException { public List<String> getTypeNamesByCategory(DataTypes.TypeCategory typeCategory) throws MetadataException {
return typeSystem.getTraitsNames(); return typeSystem.getTypeNamesByCategory(typeCategory);
} }
/** /**
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package org.apache.hadoop.metadata.services; package org.apache.hadoop.metadata.services;
import org.apache.hadoop.metadata.MetadataException; import org.apache.hadoop.metadata.MetadataException;
import org.apache.hadoop.metadata.typesystem.types.DataTypes;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
import java.util.List; import java.util.List;
...@@ -57,7 +58,7 @@ public interface MetadataService { ...@@ -57,7 +58,7 @@ public interface MetadataService {
* *
* @return list of trait type names in the type system * @return list of trait type names in the type system
*/ */
List<String> getTraitNamesList() throws MetadataException; List<String> getTypeNamesByCategory(DataTypes.TypeCategory typeCategory) throws MetadataException;
/** /**
* Creates an entity, instance of the type. * Creates an entity, instance of the type.
......
...@@ -86,7 +86,7 @@ public class TypeSystemTest extends BaseTest { ...@@ -86,7 +86,7 @@ public class TypeSystemTest extends BaseTest {
soxTrait, secTrait, financeTrait), soxTrait, secTrait, financeTrait),
ImmutableList.<HierarchicalTypeDefinition<ClassType>>of()); ImmutableList.<HierarchicalTypeDefinition<ClassType>>of());
final ImmutableList<String> traitsNames = getTypeSystem().getTraitsNames(); final ImmutableList<String> traitsNames = getTypeSystem().getTypeNamesByCategory(DataTypes.TypeCategory.TRAIT);
Assert.assertEquals(traitsNames.size(), 7); Assert.assertEquals(traitsNames.size(), 7);
List traits = Arrays.asList(new String[]{ List traits = Arrays.asList(new String[]{
"Classification", "Classification",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment