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
60d8c92a
Commit
60d8c92a
authored
Nov 9, 2011
by
Vincent Gramer
Browse files
Options
Downloads
Patches
Plain Diff
fix bug 20709
parent
07629c91
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/HdbArchivingWatcher/HdbArchivingWatcher.java
+927
-928
927 additions, 928 deletions
src/main/java/HdbArchivingWatcher/HdbArchivingWatcher.java
src/main/java/TdbArchivingWatcher/TdbArchivingWatcher.java
+939
-940
939 additions, 940 deletions
src/main/java/TdbArchivingWatcher/TdbArchivingWatcher.java
with
1866 additions
and
1868 deletions
src/main/java/HdbArchivingWatcher/HdbArchivingWatcher.java
+
927
−
928
View file @
60d8c92a
...
...
@@ -33,6 +33,7 @@ import fr.soleil.hdbtdbArchivingApi.ArchivingApi.ConfigConst;
import
fr.soleil.hdbtdbArchivingApi.ArchivingManagerApi.HdbArchivingManagerApiRef
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingTools.Mode.Mode
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingTools.Tools.ArchivingException
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.datasources.db.DBReaderFactory
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.dto.ArchivingAttribute
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.dto.ArchivingAttributeSubName
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.dto.ControlResult
;
...
...
@@ -86,7 +87,6 @@ import fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.tools.Tools;
* detected during this cycle or a previous cycle.
*/
// --------- End of States Description ----------
public
class
HdbArchivingWatcher
extends
AbsArchivingWatcher
{
// private int state;
private
final
String
m_version
;
...
...
@@ -159,6 +159,7 @@ public class HdbArchivingWatcher extends AbsArchivingWatcher {
initLifeCycleManager
(
LifeCycleManagerFactory
.
HDB_LIFE_CYCLE
);
archivingAttributeComparator
=
new
ArchivingAttributeComparator
();
dbReader
=
DBReaderFactory
.
getCurrentImpl
();
}
// =========================================================
...
...
@@ -178,23 +179,22 @@ public class HdbArchivingWatcher extends AbsArchivingWatcher {
* @return
* @throws DevFailed
*/
public
String
[]
getKOAttributesFromArchivers
(
boolean
doRetry
)
throws
DevFailed
{
List
<
String
>
archiversStatus
=
new
ArrayList
<
String
>();
String
[]
archiverNames
=
ApiUtil
.
get_db_obj
().
get_device_exported_for_class
(
HdbArchivingManagerApiRef
.
classDevice
);
Group
group
=
new
Group
(
"archivers"
);
public
String
[]
getKOAttributesFromArchivers
(
final
boolean
doRetry
)
throws
DevFailed
{
final
List
<
String
>
archiversStatus
=
new
ArrayList
<
String
>();
final
String
[]
archiverNames
=
ApiUtil
.
get_db_obj
().
get_device_exported_for_class
(
HdbArchivingManagerApiRef
.
classDevice
);
final
Group
group
=
new
Group
(
"archivers"
);
group
.
add
(
archiverNames
);
GroupCmdReplyList
replies
=
group
.
command_inout
(
"GetKOAttributes"
,
true
);
for
(
Object
reply
:
replies
)
{
GroupCmdReply
r
=
(
GroupCmdReply
)
reply
;
final
GroupCmdReplyList
replies
=
group
.
command_inout
(
"GetKOAttributes"
,
true
);
for
(
final
Object
reply
:
replies
)
{
final
GroupCmdReply
r
=
(
GroupCmdReply
)
reply
;
try
{
DeviceData
result
=
r
.
get_data
();
String
archiverStatus
=
r
.
dev_name
()
+
" "
+
Arrays
.
toString
(
result
.
extractStringArray
());
final
DeviceData
result
=
r
.
get_data
();
final
String
archiverStatus
=
r
.
dev_name
()
+
" "
+
Arrays
.
toString
(
result
.
extractStringArray
());
archiversStatus
.
add
(
archiverStatus
);
if
(
doRetry
)
{
new
DeviceProxy
(
r
.
dev_name
()).
command_inout_asynch
(
"RetryForAttribute"
,
result
,
true
);
}
}
catch
(
DevFailed
e
)
{
}
catch
(
final
DevFailed
e
)
{
archiversStatus
.
add
(
r
.
dev_name
()
+
" ERROR"
);
}
}
...
...
@@ -274,8 +274,7 @@ public class HdbArchivingWatcher extends AbsArchivingWatcher {
* @return True if archiving works correctly for this attribute
*/
// =========================================================
private
boolean
is_attribute_correctly_archived
(
final
String
argin
,
final
ControlResult
_controlResult
)
throws
DevFailed
{
private
boolean
is_attribute_correctly_archived
(
final
String
argin
,
final
ControlResult
_controlResult
)
throws
DevFailed
{
if
(
_controlResult
==
null
)
{
throw
new
DevFailed
(
HdbArchivingWatcher
.
getNotYetReadyError
());
}
...
...
@@ -442,7 +441,7 @@ public class HdbArchivingWatcher extends AbsArchivingWatcher {
get_logger
().
info
(
"Entering restart()"
);
// complete stop
LifeCycleManager
lifeCycleManager
=
getLifeCycleManager
();
final
LifeCycleManager
lifeCycleManager
=
getLifeCycleManager
();
lifeCycleManager
.
stopProcessing
();
final
Thread
watcherThread
=
lifeCycleManager
.
getAsThread
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/TdbArchivingWatcher/TdbArchivingWatcher.java
+
939
−
940
View file @
60d8c92a
...
...
@@ -33,6 +33,7 @@ import fr.soleil.hdbtdbArchivingApi.ArchivingApi.ConfigConst;
import
fr.soleil.hdbtdbArchivingApi.ArchivingManagerApi.TdbArchivingManagerApiRef
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingTools.Mode.Mode
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingTools.Tools.ArchivingException
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.datasources.db.DBReaderFactory
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.dto.ArchivingAttribute
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.dto.ArchivingAttributeSubName
;
import
fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.dto.ControlResult
;
...
...
@@ -86,7 +87,6 @@ import fr.soleil.hdbtdbArchivingApi.ArchivingWatchApi.tools.Tools;
* detected during this cycle or a previous cycle.
*/
// --------- End of States Description ----------
public
class
TdbArchivingWatcher
extends
AbsArchivingWatcher
{
// private int state;
private
final
String
m_version
;
...
...
@@ -158,9 +158,10 @@ public class TdbArchivingWatcher extends AbsArchivingWatcher {
// Initialise variables to default values
super
.
initArchivingDataWatch
();
archivingAttributeComparator
=
new
ArchivingAttributeComparator
();
initLifeCycleManager
(
LifeCycleManagerFactory
.
TDB_LIFE_CYCLE
);
archivingAttributeComparator
=
new
ArchivingAttributeComparator
();
dbReader
=
DBReaderFactory
.
getCurrentImpl
();
}
/**
...
...
@@ -169,24 +170,23 @@ public class TdbArchivingWatcher extends AbsArchivingWatcher {
* @return
* @throws DevFailed
*/
public
String
[]
getKOAttributesFromArchivers
(
boolean
doRetry
)
throws
DevFailed
{
public
String
[]
getKOAttributesFromArchivers
(
final
boolean
doRetry
)
throws
DevFailed
{
List
<
String
>
archiversStatus
=
new
ArrayList
<
String
>();
String
[]
archiverNames
=
ApiUtil
.
get_db_obj
().
get_device_exported_for_class
(
TdbArchivingManagerApiRef
.
classDevice
);
Group
group
=
new
Group
(
"archivers"
);
final
List
<
String
>
archiversStatus
=
new
ArrayList
<
String
>();
final
String
[]
archiverNames
=
ApiUtil
.
get_db_obj
().
get_device_exported_for_class
(
TdbArchivingManagerApiRef
.
classDevice
);
final
Group
group
=
new
Group
(
"archivers"
);
group
.
add
(
archiverNames
);
GroupCmdReplyList
replies
=
group
.
command_inout
(
"GetKOAttributes"
,
true
);
for
(
Object
reply
:
replies
)
{
GroupCmdReply
r
=
(
GroupCmdReply
)
reply
;
final
GroupCmdReplyList
replies
=
group
.
command_inout
(
"GetKOAttributes"
,
true
);
for
(
final
Object
reply
:
replies
)
{
final
GroupCmdReply
r
=
(
GroupCmdReply
)
reply
;
try
{
DeviceData
result
=
r
.
get_data
();
String
archiverStatus
=
r
.
dev_name
()
+
" "
+
Arrays
.
toString
(
result
.
extractStringArray
());
final
DeviceData
result
=
r
.
get_data
();
final
String
archiverStatus
=
r
.
dev_name
()
+
" "
+
Arrays
.
toString
(
result
.
extractStringArray
());
archiversStatus
.
add
(
archiverStatus
);
if
(
doRetry
)
{
new
DeviceProxy
(
r
.
dev_name
()).
command_inout_asynch
(
"RetryForAttribute"
,
result
,
true
);
}
}
catch
(
DevFailed
e
)
{
}
catch
(
final
DevFailed
e
)
{
archiversStatus
.
add
(
r
.
dev_name
()
+
" ERROR"
);
}
}
...
...
@@ -281,8 +281,7 @@ public class TdbArchivingWatcher extends AbsArchivingWatcher {
* @return True if archiving works correctly for this attribute
*/
// =========================================================
private
boolean
is_attribute_correctly_archived
(
final
String
argin
,
final
ControlResult
_controlResult
)
throws
DevFailed
{
private
boolean
is_attribute_correctly_archived
(
final
String
argin
,
final
ControlResult
_controlResult
)
throws
DevFailed
{
if
(
_controlResult
==
null
)
{
throw
new
DevFailed
(
TdbArchivingWatcher
.
getNotYetReadyError
());
}
...
...
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