Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roque
wendelin
Commits
38a46b50
Commit
38a46b50
authored
May 19, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_wendelin_data_lake_ingestion: rename and move scripts to data lake skin folder
parent
28a9e89e
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
68 additions
and
96 deletions
+68
-96
bt5/erp5_wendelin_data_lake_ingestion/PathTemplateItem/portal_callables/IngestionPolicy_parseEbulkIngestionTag.py
...ortal_callables/IngestionPolicy_parseEbulkIngestionTag.py
+3
-3
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils.xml
...plateItem/portal_skins/erp5_ingestion_reference_utils.xml
+0
-26
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/getIngestionConstantsJson.py
...p5_ingestion_reference_utils/getIngestionConstantsJson.py
+0
-13
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/DataLake_executeDataAnalysisList.py
...p5_wendelin_data_lake/DataLake_executeDataAnalysisList.py
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/DataLake_stopIngestionList.py
...ins/erp5_wendelin_data_lake/DataLake_stopIngestionList.py
+6
-6
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_checkIngestionReferenceExists.py
...delin_data_lake/ERP5Site_checkIngestionReferenceExists.py
+4
-4
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_checkIngestionReferenceExists.xml
...elin_data_lake/ERP5Site_checkIngestionReferenceExists.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_checkReferenceInvalidated.py
..._wendelin_data_lake/ERP5Site_checkReferenceInvalidated.py
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_checkReferenceInvalidated.xml
...wendelin_data_lake/ERP5Site_checkReferenceInvalidated.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getDataStreamChunk.py
...ns/erp5_wendelin_data_lake/ERP5Site_getDataStreamChunk.py
+0
-0
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getDataStreamChunk.xml
...s/erp5_wendelin_data_lake/ERP5Site_getDataStreamChunk.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getDataStreamList.py
...ins/erp5_wendelin_data_lake/ERP5Site_getDataStreamList.py
+2
-2
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getDataStreamList.xml
...ns/erp5_wendelin_data_lake/ERP5Site_getDataStreamList.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getIngestionConstantsJson.py
..._wendelin_data_lake/ERP5Site_getIngestionConstantsJson.py
+13
-0
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getIngestionConstantsJson.xml
...wendelin_data_lake/ERP5Site_getIngestionConstantsJson.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getIngestionReferenceDictionary.py
...lin_data_lake/ERP5Site_getIngestionReferenceDictionary.py
+0
-0
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getIngestionReferenceDictionary.xml
...in_data_lake/ERP5Site_getIngestionReferenceDictionary.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateIngestionObjects.py
...wendelin_data_lake/ERP5Site_invalidateIngestionObjects.py
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateReference.py
...s/erp5_wendelin_data_lake/ERP5Site_invalidateReference.py
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateReference.xml
.../erp5_wendelin_data_lake/ERP5Site_invalidateReference.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateSplitIngestions.py
..._wendelin_data_lake/ERP5Site_invalidateSplitIngestions.py
+9
-9
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_revalidateReference.py
...s/erp5_wendelin_data_lake/ERP5Site_revalidateReference.py
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_revalidateReference.xml
.../erp5_wendelin_data_lake/ERP5Site_revalidateReference.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_stopIngestionList.py
...ins/erp5_wendelin_data_lake/ERP5Site_stopIngestionList.py
+6
-6
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5_getDescriptorHTMLContent.py
.../erp5_wendelin_data_lake/ERP5_getDescriptorHTMLContent.py
+0
-0
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5_getDescriptorHTMLContent.xml
...erp5_wendelin_data_lake/ERP5_getDescriptorHTMLContent.xml
+1
-1
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/IngestionPolicy_getIngestionOperationAndParameterDictEbulk.py
...stionPolicy_getIngestionOperationAndParameterDictEbulk.py
+5
-5
bt5/erp5_wendelin_data_lake_ingestion/TestTemplateItem/portal_components/test.erp5.testDataLakeIngestion.py
...Item/portal_components/test.erp5.testDataLakeIngestion.py
+4
-4
bt5/erp5_wendelin_data_lake_ingestion/TestTemplateItem/portal_components/test.erp5.testDataLakeIngestion.xml
...tem/portal_components/test.erp5.testDataLakeIngestion.xml
+2
-3
bt5/erp5_wendelin_data_lake_ingestion/bt/template_skin_id_list
...rp5_wendelin_data_lake_ingestion/bt/template_skin_id_list
+0
-1
No files found.
bt5/erp5_wendelin_data_lake_ingestion/PathTemplateItem/portal_callables/IngestionPolicy_parseEbulkIngestionTag.py
View file @
38a46b50
portal
=
context
.
getPortalObject
()
reference_separator
=
portal
.
getIngestionReferenceDictionary
()[
"reference_separator"
]
reference_length
=
portal
.
getIngestionReferenceDictionary
()[
"reference_length"
]
invalid_chars
=
portal
.
getIngestionReferenceDictionary
()[
"invalid_chars"
]
reference_separator
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"reference_separator"
]
reference_length
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"reference_length"
]
invalid_chars
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"invalid_chars"
]
record
=
reference
.
rsplit
(
reference_separator
)
length
=
len
(
record
)
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils.xml
deleted
100644 → 0
View file @
28a9e89e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Folder"
module=
"OFS.Folder"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
erp5_ingestion_reference_utils
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_ingestion_reference_utils/getIngestionConstantsJson.py
deleted
100644 → 0
View file @
28a9e89e
import
json
portal
=
context
.
getPortalObject
()
dict
=
{
'invalid_suffix'
:
portal
.
getIngestionReferenceDictionary
()[
'invalid_suffix'
],
'split_end_suffix'
:
portal
.
getIngestionReferenceDictionary
()[
'split_end_suffix'
],
'single_end_suffix'
:
portal
.
getIngestionReferenceDictionary
()[
'single_end_suffix'
],
'split_first_suffix'
:
portal
.
getIngestionReferenceDictionary
()[
'split_first_suffix'
],
'none_extension'
:
portal
.
getIngestionReferenceDictionary
()[
'none_extension'
],
'reference_separator'
:
portal
.
getIngestionReferenceDictionary
()[
'reference_separator'
],
'complex_files_extensions'
:
portal
.
getIngestionReferenceDictionary
()[
'complex_files_extensions'
],
'reference_length'
:
portal
.
getIngestionReferenceDictionary
()[
'reference_length'
],
'invalid_chars'
:
portal
.
getIngestionReferenceDictionary
()[
'invalid_chars'
],
}
return
json
.
dumps
(
dict
)
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/DataLake_executeDataAnalysisList.py
View file @
38a46b50
from
Products.ERP5Type.Log
import
log
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
complex_files
=
portal
.
getIngestionReferenceDictionary
()[
"complex_files_extensions"
]
complex_files
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"complex_files_extensions"
]
for
data_analysis
in
portal_catalog
(
portal_type
=
"Data Analysis"
,
simulation_state
=
"planned"
):
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/DataLake_stopIngestionList.py
View file @
38a46b50
...
...
@@ -40,15 +40,15 @@ def isInterruptedAbandonedSplitIngestion(reference):
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
reference_end_single
=
portal
.
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
reference_first_split
=
portal
.
getIngestionReferenceDictionary
()[
"split_first_suffix"
]
reference_end_split
=
portal
.
getIngestionReferenceDictionary
()[
"split_end_suffix"
]
reference_end_single
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
reference_first_split
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"split_first_suffix"
]
reference_end_split
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"split_end_suffix"
]
# stop single started ingestion (not split files)
for
data_ingestion
in
portal_catalog
(
portal_type
=
"Data Ingestion"
,
simulation_state
=
"started"
,
id
=
"%"
+
reference_end_single
):
if
not
portal
.
Is
ReferenceInvalidated
(
data_ingestion
):
if
not
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_ingestion
):
related_split_ingestions
=
portal_catalog
(
portal_type
=
"Data Ingestion"
,
reference
=
data_ingestion
.
getReference
())
if
len
(
related_split_ingestions
)
==
1
:
...
...
@@ -67,7 +67,7 @@ for data_ingestion in portal_catalog(portal_type = "Data Ingestion",
for
data_ingestion
in
portal_catalog
(
portal_type
=
"Data Ingestion"
,
simulation_state
=
"started"
,
id
=
"%"
+
reference_first_split
):
if
not
portal
.
Is
ReferenceInvalidated
(
data_ingestion
):
if
not
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_ingestion
):
if
isInterruptedAbandonedSplitIngestion
(
data_ingestion
.
getReference
()):
portal
.
ERP5Site_invalidateSplitIngestions
(
data_ingestion
.
getReference
(),
success
=
False
)
else
:
...
...
@@ -102,7 +102,7 @@ for data_ingestion in portal_catalog(portal_type = "Data Ingestion",
if
ingestion
.
getSimulationState
()
==
"started"
:
ingestion
.
stop
()
else
:
portal
.
I
nvalidateReference
(
ingestion
)
portal
.
ERP5Site_i
nvalidateReference
(
ingestion
)
ingestion
.
deliver
()
except
Exception
as
e
:
context
.
logEntry
(
"ERROR appending split data streams for ingestion: %s - reference: %s."
%
(
data_ingestion
.
getId
(),
data_ingestion
.
getReference
()))
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
i
ngestionReferenceExists.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5Site_checkI
ngestionReferenceExists.py
View file @
38a46b50
...
...
@@ -10,9 +10,9 @@ TRUE = "TRUE"
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
reference_separator
=
portal
.
getIngestionReferenceDictionary
()[
"reference_separator"
]
reference_end_single
=
portal
.
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
reference_end_split
=
portal
.
getIngestionReferenceDictionary
()[
"split_end_suffix"
]
reference_separator
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"reference_separator"
]
reference_end_single
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
reference_end_split
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"split_end_suffix"
]
# remove supplier and eof from reference
data_ingestion_reference
=
reference_separator
.
join
(
reference
.
split
(
reference_separator
)[
1
:
-
3
])
...
...
@@ -20,7 +20,7 @@ EOF = reference.split(reference_separator)[-3]
size
=
reference
.
split
(
reference_separator
)[
-
2
]
if
data_ingestion_reference
is
""
:
context
.
logEntry
(
"[ERROR] Data Ingestion reference parameter for
i
ngestionReferenceExists script is not well formated"
)
context
.
logEntry
(
"[ERROR] Data Ingestion reference parameter for
ERP5Site_checkI
ngestionReferenceExists script is not well formated"
)
raise
ValueError
(
"Data Ingestion reference is not well formated"
)
# check if there are started ingestions for this reference
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
i
ngestionReferenceExists.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5Site_checkI
ngestionReferenceExists.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
i
ngestionReferenceExists
</string>
</value>
<value>
<string>
ERP5Site_checkI
ngestionReferenceExists
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/Is
ReferenceInvalidated.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_check
ReferenceInvalidated.py
View file @
38a46b50
portal
=
context
.
getPortalObject
()
INVALID_SUFFIX
=
portal
.
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
INVALID_SUFFIX
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
return
document
.
getReference
().
endswith
(
INVALID_SUFFIX
)
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/InvalidateReference
.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_checkReferenceInvalidated
.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
InvalidateReference
</string>
</value>
<value>
<string>
ERP5Site_checkReferenceInvalidated
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/getDataStreamChunk.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5Site_
getDataStreamChunk.py
View file @
38a46b50
File moved
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/getDataStreamChunk.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5Site_
getDataStreamChunk.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
getDataStreamChunk
</string>
</value>
<value>
<string>
ERP5Site_
getDataStreamChunk
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/getDataStreamList.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5Site_
getDataStreamList.py
View file @
38a46b50
...
...
@@ -11,11 +11,11 @@ from Products.ZSQLCatalog.SQLCatalog import Query, SimpleQuery, ComplexQuery
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
reference_separator
=
portal
.
getIngestionReferenceDictionary
()[
"reference_separator"
]
reference_separator
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"reference_separator"
]
try
:
data_set
=
portal
.
data_set_module
.
get
(
data_set_reference
)
if
data_set
is
None
or
portal
.
Is
ReferenceInvalidated
(
data_set
):
if
data_set
is
None
or
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_set
):
return
{
"status_code"
:
0
,
"result"
:
[]
}
except
Exception
as
e
:
# fails because unauthorized access
log
(
"Unauthorized access to getDataStreamList."
)
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/getDataStreamList.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5Site_
getDataStreamList.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
getDataStreamList
</string>
</value>
<value>
<string>
ERP5Site_
getDataStreamList
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_getIngestionConstantsJson.py
0 → 100644
View file @
38a46b50
import
json
portal
=
context
.
getPortalObject
()
dict
=
{
'invalid_suffix'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'invalid_suffix'
],
'split_end_suffix'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'split_end_suffix'
],
'single_end_suffix'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'single_end_suffix'
],
'split_first_suffix'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'split_first_suffix'
],
'none_extension'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'none_extension'
],
'reference_separator'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'reference_separator'
],
'complex_files_extensions'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'complex_files_extensions'
],
'reference_length'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'reference_length'
],
'invalid_chars'
:
portal
.
ERP5Site_getIngestionReferenceDictionary
()[
'invalid_chars'
],
}
return
json
.
dumps
(
dict
)
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/getIngestionReferenceDictionary
.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_getIngestionConstantsJson
.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
getIngestionReferenceDictionary
</string>
</value>
<value>
<string>
ERP5Site_getIngestionConstantsJson
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/
getIngestionReferenceDictionary.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_
getIngestionReferenceDictionary.py
View file @
38a46b50
File moved
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/getIngestionConstantsJson
.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_getIngestionReferenceDictionary
.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
getIngestionConstantsJson
</string>
</value>
<value>
<string>
ERP5Site_getIngestionReferenceDictionary
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateIngestionObjects.py
View file @
38a46b50
...
...
@@ -13,7 +13,7 @@ kw_dict = {"query": portal_type_query,
"reference"
:
reference
}
for
document
in
portal_catalog
(
**
kw_dict
):
portal
.
I
nvalidateReference
(
document
)
portal
.
ERP5Site_i
nvalidateReference
(
document
)
try
:
document
.
invalidate
()
except
:
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/I
nvalidateReference.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_i
nvalidateReference.py
View file @
38a46b50
portal
=
context
.
getPortalObject
()
INVALID_SUFFIX
=
portal
.
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
INVALID_SUFFIX
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
try
:
if
not
document
.
getReference
().
endswith
(
INVALID_SUFFIX
):
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/IsReferenceInvalidated
.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_invalidateReference
.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
IsReferenceInvalidated
</string>
</value>
<value>
<string>
ERP5Site_invalidateReference
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_invalidateSplitIngestions.py
View file @
38a46b50
...
...
@@ -14,34 +14,34 @@ try:
data_ingestion
=
portal_catalog
.
getResultValue
(
portal_type
=
'Data Ingestion'
,
id
=
data_stream
.
getId
())
portal
.
I
nvalidateReference
(
data_stream
)
portal
.
ERP5Site_i
nvalidateReference
(
data_stream
)
data_stream
.
invalidate
()
if
not
portal
.
Is
ReferenceInvalidated
(
data_ingestion
):
portal
.
I
nvalidateReference
(
data_ingestion
)
if
not
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_ingestion
):
portal
.
ERP5Site_i
nvalidateReference
(
data_ingestion
)
data_an
=
portal_catalog
.
getResultValue
(
portal_type
=
'Data Analysis'
,
id
=
data_stream
.
getId
())
if
data_an
!=
None
:
portal
.
I
nvalidateReference
(
data_an
)
portal
.
ERP5Site_i
nvalidateReference
(
data_an
)
data_array
=
portal_catalog
.
getResultValue
(
portal_type
=
'Data Array'
,
id
=
data_stream
.
getId
())
if
data_array
!=
None
:
portal
.
I
nvalidateReference
(
data_array
)
portal
.
ERP5Site_i
nvalidateReference
(
data_array
)
data_array
.
invalidate
()
else
:
# split ingestion interrumped and restarted
# invalidate draft datastreams and old started data ingestions
for
data_ingestion
in
portal_catalog
(
portal_type
=
"Data Ingestion"
,
simulation_state
=
"started"
,
reference
=
reference
):
if
not
portal
.
Is
ReferenceInvalidated
(
data_ingestion
):
portal
.
I
nvalidateReference
(
data_ingestion
)
if
not
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_ingestion
):
portal
.
ERP5Site_i
nvalidateReference
(
data_ingestion
)
data_ingestion
.
deliver
()
for
data_stream
in
portal_catalog
(
portal_type
=
"Data Stream"
,
validation_state
=
"draft"
,
reference
=
reference
):
if
not
portal
.
Is
ReferenceInvalidated
(
data_stream
):
portal
.
I
nvalidateReference
(
data_stream
)
if
not
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_stream
):
portal
.
ERP5Site_i
nvalidateReference
(
data_stream
)
except
Exception
as
e
:
context
.
logEntry
(
"ERROR in ERP5Site_invalidateSplitIngestions: "
+
str
(
e
))
pass
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/R
evalidateReference.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_r
evalidateReference.py
View file @
38a46b50
portal
=
context
.
getPortalObject
()
INVALID_SUFFIX
=
portal
.
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
INVALID_SUFFIX
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"invalid_suffix"
]
try
:
if
document
.
getReference
().
endswith
(
INVALID_SUFFIX
):
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
ingestion_reference_utils/R
evalidateReference.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_
wendelin_data_lake/ERP5Site_r
evalidateReference.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
R
evalidateReference
</string>
</value>
<value>
<string>
ERP5Site_r
evalidateReference
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/ERP5Site_stopIngestionList.py
View file @
38a46b50
...
...
@@ -40,15 +40,15 @@ def isInterruptedAbandonedSplitIngestion(reference):
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
reference_end_single
=
portal
.
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
reference_first_split
=
portal
.
getIngestionReferenceDictionary
()[
"split_first_suffix"
]
reference_end_split
=
portal
.
getIngestionReferenceDictionary
()[
"split_end_suffix"
]
reference_end_single
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
reference_first_split
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"split_first_suffix"
]
reference_end_split
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"split_end_suffix"
]
# stop single started ingestion (not split files)
for
data_ingestion
in
portal_catalog
(
portal_type
=
"Data Ingestion"
,
simulation_state
=
"started"
,
id
=
"%"
+
reference_end_single
):
if
not
portal
.
Is
ReferenceInvalidated
(
data_ingestion
):
if
not
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_ingestion
):
related_split_ingestions
=
portal_catalog
(
portal_type
=
"Data Ingestion"
,
reference
=
data_ingestion
.
getReference
())
if
len
(
related_split_ingestions
)
==
1
:
...
...
@@ -67,7 +67,7 @@ for data_ingestion in portal_catalog(portal_type = "Data Ingestion",
for
data_ingestion
in
portal_catalog
(
portal_type
=
"Data Ingestion"
,
simulation_state
=
"started"
,
id
=
"%"
+
reference_first_split
):
if
not
portal
.
Is
ReferenceInvalidated
(
data_ingestion
):
if
not
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_ingestion
):
if
isInterruptedAbandonedSplitIngestion
(
data_ingestion
.
getReference
()):
portal
.
ERP5Site_invalidateSplitIngestions
(
data_ingestion
.
getReference
(),
success
=
False
)
else
:
...
...
@@ -102,7 +102,7 @@ for data_ingestion in portal_catalog(portal_type = "Data Ingestion",
if
ingestion
.
getSimulationState
()
==
"started"
:
ingestion
.
stop
()
else
:
portal
.
I
nvalidateReference
(
ingestion
)
portal
.
ERP5Site_i
nvalidateReference
(
ingestion
)
ingestion
.
deliver
()
except
Exception
as
e
:
context
.
logEntry
(
"ERROR appending split data streams for ingestion: %s - reference: %s."
%
(
data_ingestion
.
getId
(),
data_ingestion
.
getReference
()))
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/getDescriptorHTMLContent.py
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5_
getDescriptorHTMLContent.py
View file @
38a46b50
File moved
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/getDescriptorHTMLContent.xml
→
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/
ERP5_
getDescriptorHTMLContent.xml
View file @
38a46b50
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
getDescriptorHTMLContent
</string>
</value>
<value>
<string>
ERP5_
getDescriptorHTMLContent
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
bt5/erp5_wendelin_data_lake_ingestion/SkinTemplateItem/portal_skins/erp5_wendelin_data_lake/IngestionPolicy_getIngestionOperationAndParameterDictEbulk.py
View file @
38a46b50
...
...
@@ -6,9 +6,9 @@ now_string = now.strftime('%Y%m%d-%H%M%S-%f')[:-3]
portal
=
context
.
getPortalObject
()
portal_catalog
=
portal
.
portal_catalog
reference_separator
=
portal
.
getIngestionReferenceDictionary
()[
"reference_separator"
]
reference_end_single
=
portal
.
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
none_extension
=
portal
.
getIngestionReferenceDictionary
()[
"none_extension"
]
reference_separator
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"reference_separator"
]
reference_end_single
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"single_end_suffix"
]
none_extension
=
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"none_extension"
]
# remove supplier, eof, size and hash from reference
reference
=
reference_separator
.
join
(
reference
.
split
(
reference_separator
)[
1
:
-
3
])
...
...
@@ -111,8 +111,8 @@ if dataset_reference is not None:
data_set
.
validate
()
except
:
data_set
=
portal
.
data_set_module
.
get
(
dataset_reference
)
if
portal
.
Is
ReferenceInvalidated
(
data_set
):
portal
.
R
evalidateReference
(
data_set
)
if
portal
.
ERP5Site_check
ReferenceInvalidated
(
data_set
):
portal
.
ERP5Site_r
evalidateReference
(
data_set
)
if
data_set
.
getValidationState
()
==
"invalidated"
:
data_set
.
validate
()
input_line
.
setDefaultAggregateValue
(
data_set
)
...
...
bt5/erp5_wendelin_data_lake_ingestion/TestTemplateItem/portal_components/test.erp5.testDataLakeIngestion.py
View file @
38a46b50
...
...
@@ -27,10 +27,10 @@ class TestDataIngestion(SecurityTestCase):
return
"DataIngestionTest"
def
afterSetUp
(
self
):
self
.
assertEqual
(
self
.
REFERENCE_SEPARATOR
,
self
.
portal
.
getIngestionReferenceDictionary
()[
"reference_separator"
])
self
.
assertEqual
(
self
.
INVALID
,
self
.
portal
.
getIngestionReferenceDictionary
()[
"invalid_suffix"
])
self
.
assertEqual
(
self
.
EOF
,
self
.
REFERENCE_SEPARATOR
+
self
.
portal
.
getIngestionReferenceDictionary
()[
"split_end_suffix"
])
self
.
assertEqual
(
self
.
PART_1
,
self
.
REFERENCE_SEPARATOR
+
self
.
portal
.
getIngestionReferenceDictionary
()[
"split_first_suffix"
])
self
.
assertEqual
(
self
.
REFERENCE_SEPARATOR
,
self
.
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"reference_separator"
])
self
.
assertEqual
(
self
.
INVALID
,
self
.
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"invalid_suffix"
])
self
.
assertEqual
(
self
.
EOF
,
self
.
REFERENCE_SEPARATOR
+
self
.
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"split_end_suffix"
])
self
.
assertEqual
(
self
.
PART_1
,
self
.
REFERENCE_SEPARATOR
+
self
.
portal
.
ERP5Site_
getIngestionReferenceDictionary
()[
"split_first_suffix"
])
def
getRandomReference
(
self
):
random_string
=
''
.
join
([
random
.
choice
(
string
.
ascii_letters
+
string
.
digits
)
for
_
in
xrange
(
10
)])
...
...
bt5/erp5_wendelin_data_lake_ingestion/TestTemplateItem/portal_components/test.erp5.testDataLakeIngestion.xml
View file @
38a46b50
...
...
@@ -46,9 +46,8 @@
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 88, 4: Unused variable \'ingestion_id\' (unused-variable)
</string>
<string>
W: 95, 34: Unused variable \'i\' (unused-variable)
</string>
<string>
W: 95, 76: Unused variable \'j\' (unused-variable)
</string>
<string>
W: 99, 34: Unused variable \'i\' (unused-variable)
</string>
<string>
W: 99, 76: Unused variable \'j\' (unused-variable)
</string>
</tuple>
</value>
</item>
...
...
bt5/erp5_wendelin_data_lake_ingestion/bt/template_skin_id_list
View file @
38a46b50
erp5_ingestion_reference_utils
erp5_wendelin_data_lake
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment