Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HdbTdbArchivingServers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango controls archiving
HdbTdbArchivingServers
Commits
2ba72562
Commit
2ba72562
authored
Mar 10, 2011
by
Gwenaelle ABEILLE
Browse files
Options
Downloads
Patches
Plain Diff
format
parent
641a4a38
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/Common/Archiver/Collector/ArchiverCollector.java
+58
-72
58 additions, 72 deletions
...ain/java/Common/Archiver/Collector/ArchiverCollector.java
with
58 additions
and
72 deletions
src/main/java/Common/Archiver/Collector/ArchiverCollector.java
+
58
−
72
View file @
2ba72562
...
...
@@ -8,7 +8,7 @@ import fr.soleil.hdbtdbArchivingApi.ArchivingTools.Tools.ScalarEvent;
public
abstract
class
ArchiverCollector
{
// This hashtable contains the mode counters by attribute
private
Hashtable
<
String
,
ModesCounters
>
m_attributeModeHandlerHastable
;
private
final
Hashtable
<
String
,
ModesCounters
>
m_attributeModeHandlerHastable
;
// Diary file
protected
ILogger
m_logger
;
...
...
@@ -30,65 +30,51 @@ public abstract class ArchiverCollector {
/* Allows to indicate to the collector that a new attribute must be managed */
protected
void
addAttribute
(
String
name
)
{
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
{
m_logger
.
trace
(
ILogger
.
LEVEL_WARNING
,
"ArchiverCollector.addAttribute : The attribute "
+
name
m_logger
.
trace
(
ILogger
.
LEVEL_WARNING
,
"ArchiverCollector.addAttribute : The attribute "
+
name
+
"already exists in the map ==> Counter Re-init"
);
m_attributeModeHandlerHastable
.
get
(
name
).
init
();
}
else
}
else
{
m_attributeModeHandlerHastable
.
put
(
name
,
new
ModesCounters
());
}
}
/* Allows to indicate to the collector that an attribute has been stopped */
protected
void
removeAttribute
(
String
name
)
{
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
{
m_attributeModeHandlerHastable
.
remove
(
name
);
}
}
/* Allows to retrieve the ModesCounters object of one attribute */
protected
ModesCounters
getModeCounter
(
String
name
)
{
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
{
return
m_attributeModeHandlerHastable
.
get
(
name
);
}
return
null
;
}
/* Creates a ScalarEvent object from the ErrorEvent with a null value */
protected
ScalarEvent
getNullValueScalarEvent
(
ErrorEvent
errorEvent
,
int
data_type
,
int
writable
)
{
return
new
ScalarEvent
(
errorEvent
.
getSource
().
toString
(),
data_type
,
writable
,
errorEvent
.
getTimeStamp
(),
null
);
protected
ScalarEvent
getNullValueScalarEvent
(
ErrorEvent
errorEvent
,
int
data_type
,
int
writable
)
{
return
new
ScalarEvent
(
errorEvent
.
getSource
().
toString
(),
data_type
,
writable
,
errorEvent
.
getTimeStamp
(),
null
);
}
/* Return true if the value must be archived, false otherwise */
protected
boolean
doArchiveEvent
(
ModesCounters
mc
,
int
dataType
,
Object
readValueObject
,
Object
lastValueObject
,
protected
boolean
doArchiveEvent
(
ModesCounters
mc
,
int
dataType
,
Object
readValueObject
,
Object
lastValueObject
,
String
attCompleteName
)
{
boolean
doArchive
=
false
;
try
{
doArchive
=
m_modeHandler
.
isDataArchivable
(
mc
,
dataType
,
readValueObject
,
lastValueObject
);
doArchive
=
m_modeHandler
.
isDataArchivable
(
mc
,
dataType
,
readValueObject
,
lastValueObject
);
}
catch
(
IllegalArgumentException
e
)
{
this
.
m_logger
.
trace
(
ILogger
.
LEVEL_ERROR
,
this
.
getClass
()
.
getSimpleName
()
+
"/doArchiveEvent/catch "
+
e
+
" with the value of "
+
attCompleteName
);
this
.
m_logger
.
trace
(
ILogger
.
LEVEL_ERROR
,
this
.
getClass
().
getSimpleName
()
+
"/doArchiveEvent/catch "
+
e
+
" with the value of "
+
attCompleteName
);
}
catch
(
ClassCastException
cce
)
{
this
.
m_logger
.
trace
(
ILogger
.
LEVEL_ERROR
,
this
.
getClass
()
.
getSimpleName
()
+
"/doArchiveEvent/catch "
+
cce
+
" with the value of "
+
attCompleteName
);
this
.
m_logger
.
trace
(
ILogger
.
LEVEL_ERROR
,
this
.
getClass
().
getSimpleName
()
+
"/doArchiveEvent/catch "
+
cce
+
" with the value of "
+
attCompleteName
);
}
catch
(
Exception
e
)
{
this
.
m_logger
.
trace
(
ILogger
.
LEVEL_ERROR
,
this
.
getClass
()
.
getSimpleName
()
+
"/doArchiveEvent/catch "
+
e
+
" with the value of "
+
attCompleteName
);
this
.
m_logger
.
trace
(
ILogger
.
LEVEL_ERROR
,
this
.
getClass
().
getSimpleName
()
+
"/doArchiveEvent/catch "
+
e
+
" with the value of "
+
attCompleteName
);
}
return
doArchive
;
...
...
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