Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Indexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Indexer
Commits
2b704969
Commit
2b704969
authored
3 years ago
by
Sviatoslav Nekhaienko
Browse files
Options
Downloads
Patches
Plain Diff
improve errors processing
parent
bf0b45f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!139
Improve errors processing for Schema service schema parsing
Pipeline
#33805
passed
3 years ago
Stage: build
Stage: scan
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/tech.md
+121
-0
121 additions, 0 deletions
.../java/org/opengroup/osdu/indexer/schema/converter/tech.md
with
121 additions
and
0 deletions
indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/tech.md
0 → 100644
+
121
−
0
View file @
2b704969
## Table of contests.
1.
Purpose
2.
Package details and main classes
3.
Unit tests
4.
Troubleshooting
5.
Schema retrieval order
6.
Converter extensions/modifications
#### Purpose
The purpose of this document is to provide overview of the Schema
converter from the technical point of view. If you need to know more
about transformations, conversion rules, please see
<https://community.opengroup.org/osdu/platform/system/indexer-service/-/blob/master/indexer-core/src/main/java/org/opengroup/osdu/indexer/schema/converter/readme.md>
#### Package details and main classes
Schema converter is in org.opengroup.osdu.indexer.schema.converter
package.
<table>
<thead>
<tr
class=
"header"
>
<th>
Name
</th>
<th>
Description
</th>
<th>
Type
</th>
</tr>
</thead>
<tbody>
<tr
class=
"odd"
>
<td>
config
</td>
<td>
Contains configuration classes, configuration can be changed via properties file
</td>
<td>
package
</td>
</tr>
<tr
class=
"even"
>
<td>
exception
</td>
<td>
Processing exceptions
</td>
<td>
package
</td>
</tr>
<tr
class=
"odd"
>
<td>
Interfaces/ SchemaToStorageFormat.java
</td>
<td><p>
Interface that provides
</p>
<p>
convertToString(String schemaServiceFormat, String kind); method
</p></td>
<td>
file
</td>
</tr>
<tr
class=
"even"
>
<td>
tags
</td>
<td>
Supported tags
</td>
<td>
package
</td>
</tr>
<tr
class=
"odd"
>
<td>
PropertiesProcessor.java
</td>
<td>
Recursively processes items
</td>
<td>
file
</td>
</tr>
<tr
class=
"even"
>
<td>
SchemaToStorageFormatImpl.java
</td>
<td>
Parse json, calls PropertiesProcessor
</td>
<td>
file
</td>
</tr>
<tr
class=
"odd"
>
<td>
Readme.md
</td>
<td></td>
<td>
file
</td>
</tr>
</tbody>
</table>
Package members.
#### Unit tests
If you have any issues with schema (loading, conversion, etc.) you can
easily create a unit test that checks a schema in
SchemaToStorageFormatImplTest class.
For instance
```
json
@Test(expected
=
SchemaProcessingException.**class**)
public
void
wrongDefinitions()
{
testSingleFile(
"/converter/bad-schema/wrong-definitions-and-missed-type.json"
**
,
KIND);
}
```
Expects that schema is wrong
testSingleFile loads a schema, tries to convert it, then compares it
with expected storage schema that is loaded from
<
filename
>
+
“.res” file.
Pay attention to folderPassed() method it recursively processes a set of
schemas in a folder.
#### Troubleshooting.
The latest schema converter tries to gather as much conversion errors as
possible (the more the better). Please see logs if conversion not
happens.
If a processing of some schema generates unexpected errors take that
schema and investigate with unit test as was described before.
#### Schema retrieval order.
Schema is retrieved from the Schema service first. If schema is not
found in the Schema Service it is retrieved from the Storage Service. If
schema is found in the Schema Service but conversion failed for some
reason the schema is not retrieved from the Storage Service. Please see
org.opengroup.osdu.indexer.service.impl.SchemaProviderImpl for details
#### Converter extensions/modifications
a) Add new tags to schema.converter.tags package
b) Modify PropertiesProcessor
c) Add/change unit and integration tests
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment