a weird issue detecting:
Some db change and Java change is applied for the currency proxy. It works well on dit but no proxy no sit. I checked everything on SIT and it looks
good. Then I compared everything (DB tables/views/packages, Java, shell script, configuration, crontab) and they look good.
Finally, I noticed that there are minor difference the time stamp between the file log and the database time stamp.
Finally, the issue is proved that
Monday, June 29, 2015
Tuesday, June 16, 2015
No need to have the admin priviledge to install MinGW
No need to have the admin priviledge to install MinGW
1. Just download the latest mingw-get-setup.exe
2. Double click and a popup GUI will show up
3. Select base MinGW and g++ compiler (for me)
4. Add C:\MinGW\bin to the user's path (no admin on Win7)
5. create a helloworld.cpp on c:\MinGW\sources:
#include <iostream>
int main()
{
std::cout << "Hello World!";
}
6. cd C:\MinGW\sources
g++ helloworld.cpp -o helloworld.exe
7. Download Eclipse CDT and enjoy the C/C++ development
The best part is that you can put everthing into C:\MinGW, it's very clean.
1. Just download the latest mingw-get-setup.exe
2. Double click and a popup GUI will show up
3. Select base MinGW and g++ compiler (for me)
4. Add C:\MinGW\bin to the user's path (no admin on Win7)
5. create a helloworld.cpp on c:\MinGW\sources:
#include <iostream>
int main()
{
std::cout << "Hello World!";
}
6. cd C:\MinGW\sources
g++ helloworld.cpp -o helloworld.exe
7. Download Eclipse CDT and enjoy the C/C++ development
The best part is that you can put everthing into C:\MinGW, it's very clean.
Tuesday, May 26, 2015
ptc_note
Assuming that the command was executed from the Windows C:\ptc\Windchill\bin directory,
xconfmanager -d wt.home
xconfmanager --help
The Java executable. Default is the wt.java.cmd
variable value specified in the $WT_HOME/
codebase/wt.propertiesfile.
The Windchill Client Architecture is Model-View-Controller based. There are two
MVC based paths available for use, a Java Builder based approach and a JSP based
approach.
Java Builder based
This approach is new for this release and is the recommended way of
implementing tables, trees, information pages, and panels of attributes. When
implementing one of these components, the configuration of the component is
specified in a ComponentConfigBuilder (java file) and the data acquisition is
specified in a ComponentDataBuilder (java file).
JSP and Tags based
This approach was used in previous releases and should only be used for
implementing wizards (create/edit) and property panels.
NmAction represents a line from actions.xml which describes a page in
Windchill. It is rendered as all the icons and links that one can click to make
changes to the Windchill system. Each jsp page should be described by an
NmAction in an xml file. The localized attributes of the NmAction can be found
in the action.properties or other rbInfo files.
NmContext represents a UI address of a page. (Note that this is becoming
obsolete and should be deprecated in the next release.)
Wizard.js functions
goBack Make the wizard go back one step
goNext Make the wizard go to the next step
In Windchill 9.x, for JCA Clients, JSP was serving both as the Controller and
View. In Windchill 10.0, we are introducing a clear separation between Controller
and View for which we are using Spring MVC Framework.
The primary motivation for this move is to enable our components to be both
requested by and rendered to any client technologies.
The servlet and servlet mapping for the Web container is defined in
<Windchill>\codebase\WEB-INF\web.xml. The below mentioned url
patterns are mapped to Spring DispatcherServlet and hence will be termed
as MVC requests.
<servlet-mapping>
<servlet-name>MVCDispatcher</servlet-name>
<url-pattern>/servlet/WizardServlet/*</url-pattern>
<url-pattern>/servlet/ActionsMenu/*</url-pattern>
<url-pattern>/servlet/RecentList/*</url-pattern>
...
Action Handling
Actions can be broadly divided into three groups.
These actions can be performed once your objects are loaded.
• Group 1 – Actions which act only on loaded data
○ Row-level and multi-select actions
○ Select all, Ctrl/Shift select, Clear all
○ View selected objects only
• Group 2 – Actions which act on the entire data set
These actions can be performed anytime (If incomplete data set, goes to the
server to get all the data)
○ Switching table views
○ Search in table
○ Export list
• Group 3 – Actions which apply to the table itself
These actions can be performed anytime
○ Create actions
○ Cancel data loading
○ Save table view
Element Type Description
*actionModels.xml XML Files which define the models where
actions are used. If an action is not already
defined in a model, one will need to be
created for the validation code to find the
action and properly set visibility.
actionmodels.xml is located in
<Windchills>/codebase; other
*actionmodels.xml files are generally in
<Windchill>/codebase /config/actions
*actions.xml XML Files where actions and other UI
components are defined. Actions are
optionally given a uicomponent value.
actions.xml is located in <Windchill>/
codebase; other *actions.xml files are
generally in <Windchill>/codebase /config/
actions.
Generic
roleaccessprefs.xml XML File for assigning default visibility to UI
components. Setting items in this file can
make them not appear at all for the site or
containers. Whether or not the container
manager can override the default value can
also be changed here.
Located in <Windchill>/codebase.
roleAccessResource.
rbInfo
XML Defines the labels to provide in the Uis for
the actions or UI components.
Located in <Windchill>/wtCustom/ com/
ptc/netmarkets/ roleAccess/.
the create folder action sample
Folder Contents -> New Document sample before actions Page 539
Action Service
Configuration of actions and action models that are available within the system
are defined using xml files. There is an action service that reads these xml files
and manages the set of actions and action models. Interaction with the service is
done via the components. Developers in general would not call the service
directly. For more detailed information about the action framework see Adding
Actions and Hooking Them Up in the UI on page 513
This section describes the action framework for the Windchill Client Architecture.
It does not include information on how to control the display of the action. For
more information on controlling the display see Related Documentation on page
548.
A service, called the StandardNmActionService manages the
set of actions and action models in the system.
StandardNmActionService .java <Windchill>\codebase\com \ptc\netmarkets\util\misc
actions.xml <Windchill>\codebase\config\actions
actionmodels.xml <Windchill>\codebase\config\actions
actions.dtd <Windchill>\codebase\config\actions
actionmodels.dtd <Windchill>\codebase\config\actions
The default actions.xml and actionmodels.xml files contain commonly used
actions, such as copy, cut, and commonly used action models such as wizard
buttons. Additional actions*.xml and actionmodels*.xml files contain
actions. and action models related to their functional areas. (e.g.
ChangeManagement-actions.xml contains actions related to change
management, PartManagement-actions.xml contains actions related to part management).
Here is an example of an action definition for the New Document wizard.
<objecttype name="document" class="wt.doc.WTDocument" resourceBundle="com.ptc.windchill.enterprise.doc.documentResource">
<action name="create" uicomponent="CREATE_DOC" dtiUpload="true">
<command class="com.ptc.windchill.enterprise.doc.forms.CreateDocFormProcessor"
method="execute" windowType="popup" onClick="validateCreateLocation(event)"/>
<includeFilter name="projectM4D" />
<nonSupportedTypes value="wt.part.WTPart"/>
<supportedTypes value="wt.doc.WTDocument"/>
</action>
</objecttype>
We support modularized actions and actionmodels within the system, so
to find what file an action is defined in, or what action models the action is used
in, there is a reporting tool that can be used. On a running Windchill installation,
you can use the Actions and ActionModels reports.
Action Report
http://<your machine name>/<app-name>/ app/#ptc1/
carambola/tools/actionReport/action The Action report allows you to search for actions managed by the
StandardNmActionService. You can search by several properties for the action
including the label (aka Description), action name, objecttype.
Debug Tool
There is also a debug mode that can be enabled in the UI that can help track down
information about a particular action on a page. See Debugging on page 442 for
information on enabling and using this tool.
Reload Action(s)
http://<your machine name>/<app-name>/app/#ptc1/carambola/tools/list
This tool reloads the action models from their xml files without having to restart
the method server.
As mention earlier in Solution Elements on page 517 section, there are two files,
custom-actions.xml and custom-actionmodels.xml, that are delivered with the
product. If you want to add/modify an action/actionmodel you can put the changes
in these files.
Toolbar Actions for a Table
Displaying Toolbar Actions for a Table
1. Define the actions in an actions.xml file. See Procedure – Defining a new
action on page 519 for more information.
2. Add the actions to an action model . See Procedure – Defining a new action on
page 519 for more information. Action models that used in the toolbar need to
contain “toolbar” in the name of the action model.
<model name="part toolbar actions">
Adding Actions and Hooking Them Up in the UI 583
<action name="create" type="Part"/>
<action name="create" type="Document"/>
…
</model>
3. Add the action model to your table by calling the setActionModel(action_
model_name) in your MVC builder:
public ComponentConfig buildComponentConfig (ComponentParams params) {
ComponentConfigFactory factory = getComponentConfigFactory ();
JcaTableConfig table = (JcaTableConfig) factory.newTableConfig ();
// add the toolbar action model to the table
table.setActionModel (“part toolbar actions”);
....
return table;
}
Soft Typing is the name of the set of Windchill capabilities that allows a
customer to, at runtime, add additional types and attributes to the out-of-thebox
Windchill Schema. This is done without having adding additional tables
to the database, without restarting the database, and without restarting the
system.
The Windchill Supported API includes those classes that customizers are meant to
work with directly. A class might be in the Supported API because it is meant to
be extended by customizers or, more likely, because it has some methods for
customizers to call.
ant -f bin/tools.xml eclipse_project.help
xconfmanager -d wt.home
xconfmanager --help
The Java executable. Default is the wt.java.cmd
variable value specified in the $WT_HOME/
codebase/wt.propertiesfile.
The Windchill Client Architecture is Model-View-Controller based. There are two
MVC based paths available for use, a Java Builder based approach and a JSP based
approach.
Java Builder based
This approach is new for this release and is the recommended way of
implementing tables, trees, information pages, and panels of attributes. When
implementing one of these components, the configuration of the component is
specified in a ComponentConfigBuilder (java file) and the data acquisition is
specified in a ComponentDataBuilder (java file).
JSP and Tags based
This approach was used in previous releases and should only be used for
implementing wizards (create/edit) and property panels.
NmAction represents a line from actions.xml which describes a page in
Windchill. It is rendered as all the icons and links that one can click to make
changes to the Windchill system. Each jsp page should be described by an
NmAction in an xml file. The localized attributes of the NmAction can be found
in the action.properties or other rbInfo files.
NmContext represents a UI address of a page. (Note that this is becoming
obsolete and should be deprecated in the next release.)
Wizard.js functions
goBack Make the wizard go back one step
goNext Make the wizard go to the next step
In Windchill 9.x, for JCA Clients, JSP was serving both as the Controller and
View. In Windchill 10.0, we are introducing a clear separation between Controller
and View for which we are using Spring MVC Framework.
The primary motivation for this move is to enable our components to be both
requested by and rendered to any client technologies.
The servlet and servlet mapping for the Web container is defined in
<Windchill>\codebase\WEB-INF\web.xml. The below mentioned url
patterns are mapped to Spring DispatcherServlet and hence will be termed
as MVC requests.
<servlet-mapping>
<servlet-name>MVCDispatcher</servlet-name>
<url-pattern>/servlet/WizardServlet/*</url-pattern>
<url-pattern>/servlet/ActionsMenu/*</url-pattern>
<url-pattern>/servlet/RecentList/*</url-pattern>
...
Action Handling
Actions can be broadly divided into three groups.
These actions can be performed once your objects are loaded.
• Group 1 – Actions which act only on loaded data
○ Row-level and multi-select actions
○ Select all, Ctrl/Shift select, Clear all
○ View selected objects only
• Group 2 – Actions which act on the entire data set
These actions can be performed anytime (If incomplete data set, goes to the
server to get all the data)
○ Switching table views
○ Search in table
○ Export list
• Group 3 – Actions which apply to the table itself
These actions can be performed anytime
○ Create actions
○ Cancel data loading
○ Save table view
Element Type Description
*actionModels.xml XML Files which define the models where
actions are used. If an action is not already
defined in a model, one will need to be
created for the validation code to find the
action and properly set visibility.
actionmodels.xml is located in
<Windchills>/codebase; other
*actionmodels.xml files are generally in
<Windchill>/codebase /config/actions
*actions.xml XML Files where actions and other UI
components are defined. Actions are
optionally given a uicomponent value.
actions.xml is located in <Windchill>/
codebase; other *actions.xml files are
generally in <Windchill>/codebase /config/
actions.
Generic
roleaccessprefs.xml XML File for assigning default visibility to UI
components. Setting items in this file can
make them not appear at all for the site or
containers. Whether or not the container
manager can override the default value can
also be changed here.
Located in <Windchill>/codebase.
roleAccessResource.
rbInfo
XML Defines the labels to provide in the Uis for
the actions or UI components.
Located in <Windchill>/wtCustom/ com/
ptc/netmarkets/ roleAccess/.
the create folder action sample
Folder Contents -> New Document sample before actions Page 539
Action Service
Configuration of actions and action models that are available within the system
are defined using xml files. There is an action service that reads these xml files
and manages the set of actions and action models. Interaction with the service is
done via the components. Developers in general would not call the service
directly. For more detailed information about the action framework see Adding
Actions and Hooking Them Up in the UI on page 513
This section describes the action framework for the Windchill Client Architecture.
It does not include information on how to control the display of the action. For
more information on controlling the display see Related Documentation on page
548.
A service, called the StandardNmActionService manages the
set of actions and action models in the system.
StandardNmActionService .java <Windchill>\codebase\com \ptc\netmarkets\util\misc
actions.xml <Windchill>\codebase\config\actions
actionmodels.xml <Windchill>\codebase\config\actions
actions.dtd <Windchill>\codebase\config\actions
actionmodels.dtd <Windchill>\codebase\config\actions
The default actions.xml and actionmodels.xml files contain commonly used
actions, such as copy, cut, and commonly used action models such as wizard
buttons. Additional actions*.xml and actionmodels*.xml files contain
actions. and action models related to their functional areas. (e.g.
ChangeManagement-actions.xml contains actions related to change
management, PartManagement-actions.xml contains actions related to part management).
Here is an example of an action definition for the New Document wizard.
<objecttype name="document" class="wt.doc.WTDocument" resourceBundle="com.ptc.windchill.enterprise.doc.documentResource">
<action name="create" uicomponent="CREATE_DOC" dtiUpload="true">
<command class="com.ptc.windchill.enterprise.doc.forms.CreateDocFormProcessor"
method="execute" windowType="popup" onClick="validateCreateLocation(event)"/>
<includeFilter name="projectM4D" />
<nonSupportedTypes value="wt.part.WTPart"/>
<supportedTypes value="wt.doc.WTDocument"/>
</action>
</objecttype>
We support modularized actions and actionmodels within the system, so
to find what file an action is defined in, or what action models the action is used
in, there is a reporting tool that can be used. On a running Windchill installation,
you can use the Actions and ActionModels reports.
Action Report
http://<your machine name>/<app-name>/ app/#ptc1/
carambola/tools/actionReport/action The Action report allows you to search for actions managed by the
StandardNmActionService. You can search by several properties for the action
including the label (aka Description), action name, objecttype.
Debug Tool
There is also a debug mode that can be enabled in the UI that can help track down
information about a particular action on a page. See Debugging on page 442 for
information on enabling and using this tool.
Reload Action(s)
http://<your machine name>/<app-name>/app/#ptc1/carambola/tools/list
This tool reloads the action models from their xml files without having to restart
the method server.
As mention earlier in Solution Elements on page 517 section, there are two files,
custom-actions.xml and custom-actionmodels.xml, that are delivered with the
product. If you want to add/modify an action/actionmodel you can put the changes
in these files.
Toolbar Actions for a Table
Displaying Toolbar Actions for a Table
1. Define the actions in an actions.xml file. See Procedure – Defining a new
action on page 519 for more information.
2. Add the actions to an action model . See Procedure – Defining a new action on
page 519 for more information. Action models that used in the toolbar need to
contain “toolbar” in the name of the action model.
<model name="part toolbar actions">
Adding Actions and Hooking Them Up in the UI 583
<action name="create" type="Part"/>
<action name="create" type="Document"/>
…
</model>
3. Add the action model to your table by calling the setActionModel(action_
model_name) in your MVC builder:
public ComponentConfig buildComponentConfig (ComponentParams params) {
ComponentConfigFactory factory = getComponentConfigFactory ();
JcaTableConfig table = (JcaTableConfig) factory.newTableConfig ();
// add the toolbar action model to the table
table.setActionModel (“part toolbar actions”);
....
return table;
}
Soft Typing is the name of the set of Windchill capabilities that allows a
customer to, at runtime, add additional types and attributes to the out-of-thebox
Windchill Schema. This is done without having adding additional tables
to the database, without restarting the database, and without restarting the
system.
The Windchill Supported API includes those classes that customizers are meant to
work with directly. A class might be in the Supported API because it is meant to
be extended by customizers or, more likely, because it has some methods for
customizers to call.
ant -f bin/tools.xml eclipse_project.help
wordsBySon
paleontologist
gecko
nocturnal
brachiosaurus/T rex/triceratops/giganotosaurus
carnivore/omnivorous
turquoise
bam
bugous
piggy-ride
platypus
meteorite
tarantula (the spider)
ogaguawa (the gorilla)
emarald
xylophone
weasel
bound choy
Ninja
platurn (star)
chrysalis
pupa
syrup
gecko
nocturnal
brachiosaurus/T rex/triceratops/giganotosaurus
carnivore/omnivorous
turquoise
bam
bugous
piggy-ride
platypus
meteorite
tarantula (the spider)
ogaguawa (the gorilla)
emarald
xylophone
weasel
bound choy
Ninja
platurn (star)
chrysalis
pupa
syrup
Hadoop: The Definitive Guide
Hadoop: The Definitive Guide
1. Sample programs:
http://www.hadoopbook.com/
1+.
Cloudera's distribution for Hadoop (CDH) is a comprehensive Apache Hadoop based management platform and Cloudera Enterprise
includes the tools, platform, and support necessary to use Hadoop in production.
This edition uses the new MapReduce API for most of the examples. The major change in Hadoop 2.0 is the new MapReduce runtime, MapReduce 2
1.2+
This, in a nutshell, is what Hadoop provides: a reliable shared storage and analysis
system. The storage is provided by HDFS and analysis by MapReduce. There are other
parts to Hadoop, but these capabilities are its kernel.
1.3+
for updating a small proportion of records in a database, a traditional
B-Tree (the data structure used in relational databases, which is limited by the
rate it can perform seeks) works well. For updating the majority of a database, a B-Tree
is less efficient than MapReduce, which uses Sort/Merge to rebuild the database.
2.
for updating a small proportion of records in a database, a traditional
B-Tree (the data structure used in relational databases, which is limited by the
rate it can perform seeks) works well. For updating the majority of a database, a B-Tree
is less efficient than MapReduce, which uses Sort/Merge to rebuild the database.
In many ways, MapReduce can be seen as a complement to a Rational Database Management
System (RDBMS).
MapReduce is a good fit for problems that need to analyze the whole dataset
in a batch fashion, particularly for ad hoc analysis. An RDBMS is good for point queries
or updates, where the dataset has been indexed to deliver low-latency retrieval and
update times of a relatively small amount of data.
MapReduce suits applications where
the data is written once and read many times, whereas a relational database is good for
datasets that are continually updated.
MapReduce works well on unstructured or semistructured
data because it is designed to interpret the data at processing time.
Normalization poses problems for MapReduce because it makes reading a record a
nonlocal operation, and one of the central assumptions that MapReduce makes is that
it is possible to perform (high-speed) streaming reads and writes.
2+
MapReduce is a linearly scalable programming model. The programmer writes two
functions—a map function and a reduce function—each of which defines a mapping
from one set of key-value pairs to another. These functions are oblivious to the size of
the data or the cluster that they are operating on, so they can be used unchanged for a
small dataset and for a massive one. More important, if you double the size of the input
data, a job will run twice as slow. But if you also double the size of the cluster, a job
will run as fast as the original one. This is not generally true of SQL queries.
MapReduce is designed to run jobs that last minutes or hours on trusted, dedicated
hardware running in a single data center with very high aggregate bandwidth interconnects.
3.
Although this may change in the future, these are areas where HDFS is not a good
fit today:
Low-latency data access
Applications that require low-latency access to data, in the tens of milliseconds
range, will not work well with HDFS. Remember, HDFS is optimized for delivering
a high throughput of data, and this may be at the expense of latency.
Lots of small files
Multiple writers, arbitrary file modifications
Files in HDFS may be written to by a single writer. Writes are always made at the
end of the file. There is no support for multiple writers or for modifications at
arbitrary offsets in the file. (These might be supported in the future, but they are
likely to be relatively inefficient.)
4.
The namenode keeps a reference to every file and block in the filesystem in memory,
which means that on very large clusters with many files, memory becomes the limiting
factor for scaling
5.
The new API makes extensive use of context objects that allow the user code to
communicate with the MapReduce system. The new Context, for example, essentially
unifies the role of the JobConf, the OutputCollector, and the Reporter from
the old API.
6.
There are two types of nodes that control the job execution process: a jobtracker and
a number of tasktrackers. The jobtracker coordinates all the jobs run on the system by
scheduling tasks to run on tasktrackers.
7.
Low-latency data access
Applications that require low-latency access to data, in the tens of milliseconds
range, will not work well with HDFS. Remember, HDFS is optimized for delivering
a high throughput of data, and this may be at the expense of latency. HBase
(Chapter 13) is currently a better choice for low-latency access.
8.
An HDFS cluster has two types of nodes operating in a master-worker pattern: a namenode
(the master) and a number of datanodes (workers). The namenode manages the
filesystem namespace. It maintains the filesystem tree and the metadata for all the files
and directories in the tree.
1. Sample programs:
http://www.hadoopbook.com/
1+.
Cloudera's distribution for Hadoop (CDH) is a comprehensive Apache Hadoop based management platform and Cloudera Enterprise
includes the tools, platform, and support necessary to use Hadoop in production.
This edition uses the new MapReduce API for most of the examples. The major change in Hadoop 2.0 is the new MapReduce runtime, MapReduce 2
1.2+
This, in a nutshell, is what Hadoop provides: a reliable shared storage and analysis
system. The storage is provided by HDFS and analysis by MapReduce. There are other
parts to Hadoop, but these capabilities are its kernel.
1.3+
for updating a small proportion of records in a database, a traditional
B-Tree (the data structure used in relational databases, which is limited by the
rate it can perform seeks) works well. For updating the majority of a database, a B-Tree
is less efficient than MapReduce, which uses Sort/Merge to rebuild the database.
2.
for updating a small proportion of records in a database, a traditional
B-Tree (the data structure used in relational databases, which is limited by the
rate it can perform seeks) works well. For updating the majority of a database, a B-Tree
is less efficient than MapReduce, which uses Sort/Merge to rebuild the database.
In many ways, MapReduce can be seen as a complement to a Rational Database Management
System (RDBMS).
MapReduce is a good fit for problems that need to analyze the whole dataset
in a batch fashion, particularly for ad hoc analysis. An RDBMS is good for point queries
or updates, where the dataset has been indexed to deliver low-latency retrieval and
update times of a relatively small amount of data.
MapReduce suits applications where
the data is written once and read many times, whereas a relational database is good for
datasets that are continually updated.
MapReduce works well on unstructured or semistructured
data because it is designed to interpret the data at processing time.
Normalization poses problems for MapReduce because it makes reading a record a
nonlocal operation, and one of the central assumptions that MapReduce makes is that
it is possible to perform (high-speed) streaming reads and writes.
2+
MapReduce is a linearly scalable programming model. The programmer writes two
functions—a map function and a reduce function—each of which defines a mapping
from one set of key-value pairs to another. These functions are oblivious to the size of
the data or the cluster that they are operating on, so they can be used unchanged for a
small dataset and for a massive one. More important, if you double the size of the input
data, a job will run twice as slow. But if you also double the size of the cluster, a job
will run as fast as the original one. This is not generally true of SQL queries.
MapReduce is designed to run jobs that last minutes or hours on trusted, dedicated
hardware running in a single data center with very high aggregate bandwidth interconnects.
3.
Although this may change in the future, these are areas where HDFS is not a good
fit today:
Low-latency data access
Applications that require low-latency access to data, in the tens of milliseconds
range, will not work well with HDFS. Remember, HDFS is optimized for delivering
a high throughput of data, and this may be at the expense of latency.
Lots of small files
Multiple writers, arbitrary file modifications
Files in HDFS may be written to by a single writer. Writes are always made at the
end of the file. There is no support for multiple writers or for modifications at
arbitrary offsets in the file. (These might be supported in the future, but they are
likely to be relatively inefficient.)
4.
The namenode keeps a reference to every file and block in the filesystem in memory,
which means that on very large clusters with many files, memory becomes the limiting
factor for scaling
5.
The new API makes extensive use of context objects that allow the user code to
communicate with the MapReduce system. The new Context, for example, essentially
unifies the role of the JobConf, the OutputCollector, and the Reporter from
the old API.
6.
There are two types of nodes that control the job execution process: a jobtracker and
a number of tasktrackers. The jobtracker coordinates all the jobs run on the system by
scheduling tasks to run on tasktrackers.
7.
Low-latency data access
Applications that require low-latency access to data, in the tens of milliseconds
range, will not work well with HDFS. Remember, HDFS is optimized for delivering
a high throughput of data, and this may be at the expense of latency. HBase
(Chapter 13) is currently a better choice for low-latency access.
8.
An HDFS cluster has two types of nodes operating in a master-worker pattern: a namenode
(the master) and a number of datanodes (workers). The namenode manages the
filesystem namespace. It maintains the filesystem tree and the metadata for all the files
and directories in the tree.
SpringInAction_note
1. The act of creating associations between appli-
cation components is commonly referred to as wiring.
2. There’s no single Spring container. Spring comes with several container implementa-
tions that can be categorized into two distinct types. Bean factories (defined by the
org.springframework.beans.factory.BeanFactory interface) are the simplest of
containers, providing basic support for DI. Application contexts (defined by the
org.springframework.context.ApplicationContext interface) build on the notion
of a bean factory by providing application framework services, such as the ability to
resolve textual messages from a properties file and the ability to publish application
events to interested event listeners.
3. By default, all Spring beans are singletons.
To force Spring to produce a new bean instance each time one is needed,
you should declare the bean’s scope attribute to be prototype.
<bean id="ticket"
class="com.springinaction.springidol.Ticket"scope="prototype"/>
To set a property to null, you simply use the <null/> element.
4. Spring provides four flavors of autowiring:
byName—Attempts to match all properties of the autowired bean with beans
that have the same name (or ID) as the properties. Properties for which there’s
no matching bean will remain unwired.
byType—Attempts to match all properties of the autowired bean with beans
whose types are assignable to the properties. Properties for which there’s no
matching bean will remain unwired.
constructor—Tries to match up a constructor of the autowired bean with
beans whose types are assignable to the constructor arguments.
autodetect—Attempts to apply constructor autowiring first. If that fails,
byType will be tried.
Autowiring using byType works in a similar way to byName, except that instead of con-
sidering a property’s name, the property’s type is examined.
5. Since Spring 2.5, one of the most interesting ways of wiring beans in Spring has been
to use annotations to automatically wire bean properties.
Annotation wiring isn’t turned on in the Spring container by default. So, before we
can use annotation-based autowiring, we’ll need to enable it in our Spring configura-
tion. The simplest way to do that is with the <context:annotation-config>
6. Spring 3 supports a few different annotations for autowiring:
Spring’s own @Autowired annotation
The @Inject annotation from JSR-330
The @Resource annotation from JSR-250
7.
@Autowired(required=false)
private Instrumentinstrument;
Here, Spring will try to wire the instrument property. But if no bean of type
Instrument can be found, then no problem. The property will be left null.
The centerpiece of JSR-330 is the @Inject annotation. This annotation is an almost
complete drop-in replacement for Spring’s @Autowired annotation. Unlike @Autowired, @Inject doesn’t have a required attribute.
8.
The <context:component-scan> element
does everything that <context:annotation-config> does, plus it configures
Spring to automatically discover beans and declare them for you. What this means is
that most (or all) of the beans in your Spring application can be declared and wired
without using <bean>.
By default, <context:component-scan> looks for classes that are annotated with one
of a handful of special stereotype annotations:
@Component—A general-purpose stereotype annotation indicating that the class
is a Spring component
@Controller—Indicates that the class defines a Spring MVC controller
@Repository—Indicates that the class defines a data repository
@Service—Indicates that the class defines a service
Any custom annotation that is itself annotated with @Component
cation components is commonly referred to as wiring.
2. There’s no single Spring container. Spring comes with several container implementa-
tions that can be categorized into two distinct types. Bean factories (defined by the
org.springframework.beans.factory.BeanFactory interface) are the simplest of
containers, providing basic support for DI. Application contexts (defined by the
org.springframework.context.ApplicationContext interface) build on the notion
of a bean factory by providing application framework services, such as the ability to
resolve textual messages from a properties file and the ability to publish application
events to interested event listeners.
3. By default, all Spring beans are singletons.
To force Spring to produce a new bean instance each time one is needed,
you should declare the bean’s scope attribute to be prototype.
<bean id="ticket"
class="com.springinaction.springidol.Ticket"scope="prototype"/>
To set a property to null, you simply use the <null/> element.
4. Spring provides four flavors of autowiring:
byName—Attempts to match all properties of the autowired bean with beans
that have the same name (or ID) as the properties. Properties for which there’s
no matching bean will remain unwired.
byType—Attempts to match all properties of the autowired bean with beans
whose types are assignable to the properties. Properties for which there’s no
matching bean will remain unwired.
constructor—Tries to match up a constructor of the autowired bean with
beans whose types are assignable to the constructor arguments.
autodetect—Attempts to apply constructor autowiring first. If that fails,
byType will be tried.
Autowiring using byType works in a similar way to byName, except that instead of con-
sidering a property’s name, the property’s type is examined.
5. Since Spring 2.5, one of the most interesting ways of wiring beans in Spring has been
to use annotations to automatically wire bean properties.
Annotation wiring isn’t turned on in the Spring container by default. So, before we
can use annotation-based autowiring, we’ll need to enable it in our Spring configura-
tion. The simplest way to do that is with the <context:annotation-config>
6. Spring 3 supports a few different annotations for autowiring:
Spring’s own @Autowired annotation
The @Inject annotation from JSR-330
The @Resource annotation from JSR-250
7.
@Autowired(required=false)
private Instrumentinstrument;
Here, Spring will try to wire the instrument property. But if no bean of type
Instrument can be found, then no problem. The property will be left null.
The centerpiece of JSR-330 is the @Inject annotation. This annotation is an almost
complete drop-in replacement for Spring’s @Autowired annotation. Unlike @Autowired, @Inject doesn’t have a required attribute.
8.
The <context:component-scan> element
does everything that <context:annotation-config> does, plus it configures
Spring to automatically discover beans and declare them for you. What this means is
that most (or all) of the beans in your Spring application can be declared and wired
without using <bean>.
By default, <context:component-scan> looks for classes that are annotated with one
of a handful of special stereotype annotations:
@Component—A general-purpose stereotype annotation indicating that the class
is a Spring component
@Controller—Indicates that the class defines a Spring MVC controller
@Repository—Indicates that the class defines a data repository
@Service—Indicates that the class defines a service
Any custom annotation that is itself annotated with @Component
web service_note
On the client side, as I mentioned, cookies are handled automatically when you use the higher-level network functions. ?
1.
Implement the web service server side from the scratch
2.
Deploy the updated web service server side to the server
3.
Continue the web service GUI client
4.
Test the connect/disconnect
5.
Implement the GetBaseline method
Implement CreatePDF by returning the server PDF
6.
Write the document
7.
Distribute (ant backup)
1. On a technical level, web services can be implemented in various ways. The two types of web
services discussed in this section can be distinguished as “big” web services and “RESTful” web services.
JAX-WS provides the functionality for “big” web services, which use XML messages that follow the Simple Object
Access Protocol (SOAP) standard, an XML language defining a message architecture and message formats. Such systems often contain
a machine-readable description of the operations offered by the service, written in the Web Services Description Language (WSDL),
an XML language for defining interfaces syntactically.
JAX-RS provides the functionality for Representational State Transfer (RESTful) web services. REST is well suited for basic, ad hoc
integration scenarios. RESTful web services, often better integrated with HTTP than SOAP-based services are, do not require XML
messages or WSDL service–API definitions. Because RESTful web services use existing well-known W3C and Internet Engineering
Task Force (IETF) standards (HTTP, XML, URI, MIME) and have a lightweight infrastructure that allows services to
be built with minimal tooling, developing RESTful web services is inexpensive and thus has a very low barrier for adoption.
A RESTful design may be appropriate when the following conditions are met.
The web services are completely stateless. A good test is to consider whether the interaction can survive a restart of the server.
A caching infrastructure can be leveraged for performance.
The service producer and service consumer have a mutual understanding of the context and content being passed along. Because there
is no formal way to describe the web services interface, both parties must agree out of band on the schemas that describe the data
being exchanged and on ways to process it meaningfully. In the real world, most commercial applications that expose services as
RESTful implementations also distribute so-called value-added toolkits that describe the interfaces to developers in popular programming languages.
Bandwidth is particularly important and needs to be limited. REST is particularly useful for limited-profile devices, such as PDAs
and mobile phones, for which the overhead of headers and additional layers of SOAP elements on the XML payload must be restricted.
Although SOAP messages are complex, the JAX-WS API hides this complexity from the application developer. On the server side, the developer
specifies the web service operations by defining methods in an interface written in the Java programming language. The developer also codes
one or more classes that implement those methods. Client programs are also easy to code. A client creates a proxy (a local object
representing the service) and then simply invokes methods on the proxy. With JAX-WS, the developer does not generate or parse SOAP
messages. It is the JAX-WS runtime system that converts the API calls and responses to and from SOAP messages.
the default style is document.
A service endpoint interface or service endpoint implementation (SEI) is a Java interface or class, respectively, that declares the
methods that a client can invoke on the service. An interface is not required when building a JAX-WS endpoint. The web service
implementation class implicitly defines an SEI.
You may specify an explicit interface by adding the endpointInterface element to the @WebService annotation in the implementation
class. You must then provide an interface that defines the public methods made available in the endpoint implementation class.
Business methods that are exposed to web service clients must have JAXB-compatible parameters and return types.
The implementing class may use the javax.annotation.PostConstruct or the javax.annotation.PreDestroy annotations on its methods for lifecycle
event callbacks.
1.
Implement the web service server side from the scratch
2.
Deploy the updated web service server side to the server
3.
Continue the web service GUI client
4.
Test the connect/disconnect
5.
Implement the GetBaseline method
Implement CreatePDF by returning the server PDF
6.
Write the document
7.
Distribute (ant backup)
1. On a technical level, web services can be implemented in various ways. The two types of web
services discussed in this section can be distinguished as “big” web services and “RESTful” web services.
JAX-WS provides the functionality for “big” web services, which use XML messages that follow the Simple Object
Access Protocol (SOAP) standard, an XML language defining a message architecture and message formats. Such systems often contain
a machine-readable description of the operations offered by the service, written in the Web Services Description Language (WSDL),
an XML language for defining interfaces syntactically.
JAX-RS provides the functionality for Representational State Transfer (RESTful) web services. REST is well suited for basic, ad hoc
integration scenarios. RESTful web services, often better integrated with HTTP than SOAP-based services are, do not require XML
messages or WSDL service–API definitions. Because RESTful web services use existing well-known W3C and Internet Engineering
Task Force (IETF) standards (HTTP, XML, URI, MIME) and have a lightweight infrastructure that allows services to
be built with minimal tooling, developing RESTful web services is inexpensive and thus has a very low barrier for adoption.
A RESTful design may be appropriate when the following conditions are met.
The web services are completely stateless. A good test is to consider whether the interaction can survive a restart of the server.
A caching infrastructure can be leveraged for performance.
The service producer and service consumer have a mutual understanding of the context and content being passed along. Because there
is no formal way to describe the web services interface, both parties must agree out of band on the schemas that describe the data
being exchanged and on ways to process it meaningfully. In the real world, most commercial applications that expose services as
RESTful implementations also distribute so-called value-added toolkits that describe the interfaces to developers in popular programming languages.
Bandwidth is particularly important and needs to be limited. REST is particularly useful for limited-profile devices, such as PDAs
and mobile phones, for which the overhead of headers and additional layers of SOAP elements on the XML payload must be restricted.
Although SOAP messages are complex, the JAX-WS API hides this complexity from the application developer. On the server side, the developer
specifies the web service operations by defining methods in an interface written in the Java programming language. The developer also codes
one or more classes that implement those methods. Client programs are also easy to code. A client creates a proxy (a local object
representing the service) and then simply invokes methods on the proxy. With JAX-WS, the developer does not generate or parse SOAP
messages. It is the JAX-WS runtime system that converts the API calls and responses to and from SOAP messages.
the default style is document.
A service endpoint interface or service endpoint implementation (SEI) is a Java interface or class, respectively, that declares the
methods that a client can invoke on the service. An interface is not required when building a JAX-WS endpoint. The web service
implementation class implicitly defines an SEI.
You may specify an explicit interface by adding the endpointInterface element to the @WebService annotation in the implementation
class. You must then provide an interface that defines the public methods made available in the endpoint implementation class.
Business methods that are exposed to web service clients must have JAXB-compatible parameters and return types.
The implementing class may use the javax.annotation.PostConstruct or the javax.annotation.PreDestroy annotations on its methods for lifecycle
event callbacks.
Subscribe to:
Posts (Atom)