|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/8/2009 5:31:22 PM
Posts: 30,
Visits: 55
|
|
These are very elementary compilation errors. There are symbols in your code that the compiler cannot find. You need to go through all the errors and figure out what symbols the compiler is complaining about. For example, this line:
lastPercentInState.put(preferences.getSystem(), statistics.getPercentInState());
lastPercentInState is a variable that is never declared.
Viewpoint Framework Development
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/7/2009 9:55:02 AM
Posts: 38,
Visits: 147
|
|
|
Could you tell me how I can edit the sample Heatmap widget which is included in the Widgetopia to display information from my database? I think it will really further help me with what I am doing.
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/8/2009 5:31:22 PM
Posts: 30,
Visits: 55
|
|
You will need to provide more information:
1. What database are you referring to? The Teradata database, the DCS cache database, a third-party database?
2. What information do you want to display?
Viewpoint Framework Development
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/7/2009 9:55:02 AM
Posts: 38,
Visits: 147
|
|
|
The DCS cache database. You know how you can display information from your DCS with the DynamicQuery portlet? Well, I'm trying to use that same DCS to display information on one of those sample portlets. Preferably the Heatmap widget on Widgetopia.
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/8/2009 5:31:22 PM
Posts: 30,
Visits: 55
|
|
You have yourself confused here.
The DynamicQuery portlet displays query result sets from queries run directly against the Teradata database. It connects directly to the Teradata database and runs the query you type in, displaying the results of the query.
The DCS cache database is where DCS data collectors persist the data they have collected from the Teradata database.
I have given you a basic template to retrieve and display data from the DCS cache database on earlier pages of this thread. It is virtually a cut and paste template that you can reuse for retrieving all types of data. To retrieve data from the DCS cache database, you use the DAOs that have been supplied to you. These DAOs return a List of Model objects with the data. The key to understanding the data is the javadocs. The javadocs for the DAOs and the Models contain the documentation that describes the data associated with them.
1. Take a look the API documentation (should be in tdpdk-xx.xx.xx.xx\doc\api). Find the documentation for the package com.teradata.dcs.data.model. All the classes in that package represent the metrics that are collected by the DCS and logged to PostgreSQL currently. Look through the classes and find the metrics (ie. the information you want to display) and take note of what class they are associated with.
2. Each class should have a corresponding Data Access Object (DAO) class that resides under com.teradata.data.dcs.dao. The DAO is what you use to retrieve the data from PostgreSQL.
I cannot give you specific help beyond that without you giving me more specific information related to the type of data you are trying to retrieve and display. Different types of information are associated with different DAOs, Models, etc.
Viewpoint Framework Development
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/7/2009 9:55:02 AM
Posts: 38,
Visits: 147
|
|
Ok let me just throw away that question and explain whats going on. I'm building a portlet that displays system health. I wasn't sure if I could display systemhealth on any widget but you explained to me that it was possible to do that. I've decided to use the TableWidget which was used the the SkewedSessions Tutorial. Now, I was confused about how you fetch the data because on the SkewedSessions tutotial the "getCurrentActiveSessions" was used with List and I tried the same with my code but I get this error.
[javac] C:\SystemHealth\src\java\com\teradata\portlets\systemhealth\service\
impl\SystemHealthManagerImpl.java:53: getCurrentSystemHealth(int) in com.teradat
a.dcs.data.dao.SystemHealthDAO cannot be applied to (java.util.List<java.lang.In
teger>)
[javac] result = systemHealthDAO.getCurrentSystemHealth(systemId
s);
[javac]
I have also copied the section I am talking about and the copy of my code. I wasn't sure where the data is being fetched from so I think thats where I confused myself. Could you help me with this code?
/**
* Gets a list of active skewed sessions running on the specified system. Each list
* item is a session model.
*
* @param preferences The user's portlet preferences for this portlet instance.
*/
public List getCurrentSkewedSessions(SkewedSessionsPreferences preferences)
{
List ();
Integer id = getSystemId(preferences.getSystem());
if (id != null)
{
List ();
systemIds.add(id);
// fetch the data
result = sessionDAO.getCurrentActiveSessions(systemIds);
}
return result;
}
------------------------------MY CODE-------------------------------------------------------------
public List getCurrentActiveSystemHealth(SystemHealthPreferences preferences)
{
List ();
Integer id = getSystemId(preferences.getSystem());
if (id != null)
{
List ();
systemIds.add(id);
// fetch the data
result = systemHealthDAO.getCurrentSystemHealth(systemIds);
}
return result;
}
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/8/2009 5:31:22 PM
Posts: 30,
Visits: 55
|
|
You are trying to pass in a List of Integer objects to the getCurrentSystemHealth(int) function. This function takes a single system id int (or Integer) only:
public List getCurrentActiveSystemHealth(SystemHealthPreferences preferences)
{
Integer id = getSystemId(preferences.getSystem());
if (id != null)
{
// fetch the data
result = systemHealthDAO.getCurrentSystemHealth(id);
}
return result;
}
Viewpoint Framework Development
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/7/2009 9:55:02 AM
Posts: 38,
Visits: 147
|
|
What about the result variable? It won't be able to find the symbol for that and "Id"
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/8/2009 5:31:22 PM
Posts: 30,
Visits: 55
|
|
Sure, you will need that as well:
public List getCurrentActiveSystemHealth(SystemHealthPreferences preferences)
{
SystemHealth result;
Integer id = getSystemId(preferences.getSystem());
if (id != null)
{
// fetch the data
result = systemHealthDAO.getCurrentSystemHealth(id);
}
return result;
}
Viewpoint Framework Development
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 7/7/2009 9:55:02 AM
Posts: 38,
Visits: 147
|
|
I'm getting a new error.
[javac] C:\SystemHealth\src\java\com\teradata\portlets\systemhealth\service\
impl\SystemHealthManagerImpl.java:57: incompatible types
[javac] found : com.teradata.dcs.data.model.SystemHealth
[javac] required: java.util.List
[javac] return result;
|
|