Advanced_Domain_Models_in_Grails

合集下载

Groovy轻松入门——Grails实战之GORM

Groovy轻松入门——Grails实战之GORM

Groovy轻松入门——Grails实战之GORMGORM就是以前我刚学Groovy没多久时想实现的功能它使开发人员不需要关心数据库方面也不需要任何配置只需专心用OO思想设计自己的系统还有一个好处就是开发时不用备份数据库因为GORM 会自动帮你建表以及约束(但数据库需要你自己建) 让我们来看一下用Grails开发是多么简单高效吧!在Grails +中配置稍有不同详见朝花夕拾——Groovy & Grails 在写域类时无须添加与业务无关的属性比如在用Hibernate时我们需要(不强制)在类中定义id 但用GORM时 id无须自己声明 GORM 会帮我们自动添加id和version GORM通过反射机制获得域类属性信息决定数据库字段类型所以在定义域类时不要使用def关键字来定义属性务必明确定义属性类型比如在下面的域类Article中用String来定义content(而不是def content) 在默认情况下 String映射到数据库中的字段类型是VARCHAR(Date映射到数据库中的字段类型是DATETIME) 如果通过类变量contraints定义了String的长度范围且长度过长映射到数据库中的字段类型会变为TEXT 十分智能class Article { Date dateAdded // Date 映射到数据库中的字段类型是DATETIME String content static constraints = { content(blank: false size: ) // 如果没有定义content的大小范围它在数据库中类型为VARCHAR最大长度是// 显然不满足我们的需求这样定义后数据库中的字段类型会变为TEXT } } 如果将数据源/grails app/conf/XXXDataSource中的String dbCreate = update Grails会自动帮我们同步内存和数据库中域类对象的状态这点是很方便的不需要在每次修改对象后 update了(GORM 中的save()相当于Hibernate中的saveOrUpdate()) 其好处犹如Java 中 new出一个对象当不再使用此对象时不需要自行delete一样在实际开发中您就会体会到了下面让我们看一下GORM中的 : :N N: N:N以及继承关系映射一对一关系class Dog { String name Tail tail // 狗有一条尾巴} class Tail { float size Dog owner // 尾巴也知道自己属于那只狗}现在Dog和Tail的一对一关系是双向的当然你也可以去掉T ail类中的owner属性或Dog类中的tail属性使一对一关系变为单向的级联删除当Dog对象被删除时则Dog对象所引用的Tail对象也将被相应删除;同样地当Tail对象被删除时Tail对象所引用的Dog对象也将被相应删除如果你认为Tail被切除后Dog应该还活着即Tail 对象删除后 Tail对象所应用的Dog对象不应该被删除那么我们可以通过在Tail类中声明类变量belongsT o来实现在这个场景中我们将Tail 改为class Tail { float size Dog owner // 尾巴也知道自己属于那只狗static belongsT o = Dog // 注意是static的} 级联更新/保存当Dog对象更新/保存 Dog对象所引用的Trail对象也更新/保存;反之亦然一对多多对一关系class Dog { String name static hasMany = [feet: Foot] // 通过声明类变量hasMany 来定义Dog 一这方有多Foot } class Foot { float size Dog owner static belongsTo = Dog // 在一对多多对一关系中默认多方belongsTo 一方} 关于保存更新和删除与一对一关系相同都是级联更新/保存和级联删除当Dog被删除时由于Foot belongsT o(属于) Dog 所以Dog 对象所引用的所有Foot对象全被删除;而当Foot对象被删除时Dog 对象不会被删除这是通过类变量belongsTo实现的多对多关系class Teacher { String name static hasMany = [students: Student] } class Student { String name static hasMany = [teachers: Teacher] static belongsTo = Teacher // 在多对多关系中至少有一方声明类变量belongsTo } 更新/保存在多对多关系中相对一对一一对多多对一关系中要特殊点就是只有拥有方可以级联更新/保存比如在本例中由于Student belongsTo Teacher 所以Teacher是拥有方Teacher的更新/保存将引起Teacher对象所引用的所有Student对象的更新/保存删除也有点特殊拥有方被删除后它所引用的对象不会被删除你必须自己删除它们否则它们将成为孤儿继承关系class Base { } class Derived extends Base { }只要定义类无需任何配置够简单吧lishixinzhi/Article/program/Java/hx/201311/26540。

idea中advanced setting

idea中advanced setting

在IntelliJ IDEA中,“Advanced Settings”通常指的是一系列高级设置和配置,这些设置可以让你更加定制化地使用IDEA。

这可能包括以下几个方面:
1.性能和内存设置:你可以在这里调整IDEA的性能和内存使用。

例如,你可
以设置IDEA使用的最大内存量,或者调整其在后台运行的线程数量等。

2.外观和主题设置:在“Advanced Settings”中,你可以自定义IDEA的界
面风格和主题。

例如,你可以更改编辑器的字体、字体大小,以及主题颜色等。

3.插件和扩展设置:如果你安装了额外的插件或扩展,你可以在这里管理它
们。

例如,你可以启用或禁用某个插件,或者调整其设置。

4.调试和运行配置:你可以在这里配置IDEA的调试和运行环境。

例如,你可
以设置调试会话的参数,或者配置运行/调试配置文件等。

5.其他高级设置:除了上述设置外,IDEA还提供了许多其他高级设置。

这些
设置可以让你更深入地定制IDEA,以满足你的具体需求。

总的来说,“Advanced Settings”是一个非常强大的工具,它可以帮助你根据个人喜好和工作流程来定制IDEA。

如果你想要更深入地了解和使用这些设置,我建议查阅IDEA的官方文档或相关教程。

VMware vSphere Flash Read Cache 与 XstreamCORE 集成配置

VMware vSphere Flash Read Cache 与 XstreamCORE 集成配置

The Power Behind the Storage+1.716.691.1999 | T ake advanTage of vM ware v S phere ® f laSh r ead C aChe ™ (v frC) wiTh X STreaM Core™Adding remote flash to ESXi™ hosts and allocating it as read cache is supported inVMware® as of ESXi 5.5. VMware vFRC is a feature that allows hosts to use solid state drives as a caching layer for virtual machines virtual disks to improve performance by moving frequently read information closer to the CPU. Now SAS shelves of SSDs can be added to the datacenter where hosts can be allocated and assigned the flash they need to improve each VMs read performance.VMware has published vFRC performance numbers that show database performance can be increased between 47% - 145% through proper sizing and application of vFRC. vFRC requires VMware vSphere® Enterprise Plus™ edition.X STreaM Core® addS f laSh SSd S To up To 64 hoSTS per applianCe pairATTO XstreamCORE® interfaces with commodity shelves of up to 240 total SAS/SATASSDs per appliance. XstreamCORE supports the ability to map Fibre Channel initiators directly to SAS LUNs up to a maximum of 64 ESXi hosts. This benefits hosts that may be space constrained from adding SSD drives, such as blade servers or servers without free drive slots. ATTO recommends that appliances be installed in pairs for redundancy both in Fibre Channel pathways as well as to connect to multiple SAS controllers of a JBOF shelf. Multiple XstreamCORE appliance pairs can be added to a fabric to support far more than 64 hosts in a single data center.X STreaM Core e liMinaTeS The need for e nTerpriSe S Torage • XstreamCORE FC 7550/7600 presents SAS/SATA SSDs on Fibre Channel fabrics to allESXi hosts for use as local SSD flash for hosts and read cache for VMs or even rawSSD capacity storage space •Allows the use of commodity JBOFs to scale up to 240 total SSD devices perappliance pair instead of more expensive All Flash or Enterprise storage •No hardware or software licensing required to utilize all XstreamCORE features •XstreamCORE features the ATTO xCORE processor which accelerates all I/O inhardware ensuring a deterministic, consistent protocol conversion latency of lessthan 4 microseconds •XstreamCORE advanced features including host group mapping, which isolatesspecific Fibre Channel initiators to specific SSD LUNs ensuring hosts can only seethe SSDs they are allocated. This mapping can be quickly and easily changed as host needs and additional SSDs are added to the environmentXstreamCORE connects up to 10 shelves of flash SSDs to a Fibre Channel fabric and then to up to 64 VMware ESXi hosts. This storage is then set up as remote flash for hosts or as SSD LUNs to scale up existing storage.ATTO XstreamCORE 7550 or 76006Gb and 12Gb SSD JBOF Shelvesa dding SSd S aS r ead C aChe via f ibre C hannelXstreamCORE listed in the VMware Compatibility Guide07/10/19Host Read Cache for VMware DatacentersAddexternAlSAS/SAtA SSd F lASh with M ultipAthing And F ibre C hAnnel Support。

Oracle Fusion Middleware监控与管理:使用Java EE管理API为Oracl

Oracle Fusion Middleware监控与管理:使用Java EE管理API为Oracl

Oracle® Fusion MiddlewareMonitoring and Managing With the Java EE Management APIs for Oracle WebLogic Server11g Release 1 (10.3.3)E13736-03April 2010This document describes the Java EE Management APIs which enable a softwaredeveloper to create a single Java program that can discover and browse resources,such as JDBC connection pools and deployed applications, on any Java EE Webapplication server.1Introduction and RoadmapThe Java EE Management specification describes a standard data model formonitoring and managing the runtime state of any Java EE Web application server andits resources. It includes standard mappings of the model through a Java EEManagement EJB Component (MEJB).The following sections describe the contents and organization of thisguide—Monitoring and Managing With the Java EE Management APIs for Oracle WebLogicServer:■Section1.1, "Document Scope and Audience"■Section1.2, "Guide to This Document"■Section1.3, "Related Documentation"1.1Document Scope and AudienceThis document is a resource for software developers who develop managementservices for Java EE applications and for software vendors who developJMX-compatible management systems. It also contains information that is useful forbusiness analysts and system architects who are evaluating WebLogic Server orconsidering the use of JMX for a particular application.The information in this document is relevant during the design and developmentphases of a software project. The document does not address production phaseadministration, monitoring, or performance tuning topics. For links to WebLogicServer documentation and resources for these topics, see Section1.3, "RelatedDocumentation".It is assumed that the reader is familiar with Java EE and general applicationmanagement concepts. This document emphasizes a hands-on approach to developinga limited but useful set of JMX management services. For information on applyingJMX to a broader set of management problems, refer to the JMX specification or otherdocuments listed in Section1.3, "Related Documentation".1.2Guide to This DocumentThis document is organized as follows:■This chapter, Section1, "Introduction and Roadmap," describes the scope and organization of this guide.■Section2, "Using the Java EE Management APIs on WebLogic Server," introduces JMX and describes common ways to use it in conjunction with other WebLogic Server management features.1.3Related DocumentationThe Sun Developer Network includes a Web site that provides links to books, white papers, and additional information on JMX:/javase/technologies/core/mntr-mgmt/javamanag ement/.To view the JMX 1.2 specification and API documentation, download it from/aboutJava/communityprocess/final/jsr003/index3.ht ml.To view the JMX Remote API 1.0 specification and API documentation, download it from/aboutJava/communityprocess/final/jsr160/index.htm l.For guidelines on developing other types of management services for WebLogic Server applications, see the following documents:■Using WebLogic Logging Services for Application Logging describes WebLogic support for internationalization and localization of log messages, and shows you how to use the templates and tools provided with WebLogic Server to create or editmessage catalogs that are locale-specific.■Configuring and Using the WebLogic Diagnostic Framework describes how system administrators can collect application monitoring data that has not been exposed through JMX, logging, or other management facilities.For guidelines on developing and tuning WebLogic Server applications, see the following documents:■Developing Applications with WebLogic Server is a guide to developing WebLogic Server applications.■Developing Manageable Applications with JMX describes how to create and register custom MBeans.2Using the Java EE Management APIs on WebLogic ServerThe Java EE Management APIs enable a software developer to create a single Java program that can discover and browse resources, such as JDBC connection pools and deployed applications, on any Java EE Web application server. The APIs are part of the Java EE Management Specification, which requires all Java EE Web application servers to describe their resources in a standard data model.The following sections describe how to use the Java EE Management APIs on WebLogic Server:■Section2.1, "Understanding the Java EE Management Model and APIs"■Section2.2, "The Java EE Management Model on WebLogic Server"■Section2.3, "Accessing the MEJB on WebLogic Server"2.1Understanding the Java EE Management Model and APIsIn the Java EE Management data model, each instance of a Web application server resource type is represented by a Java EE Managed Object (JMO). The Java EE Management Specification describes exactly which types of resources must be represented by a JMO. JMOs themselves contain only a limited set of attributes, which are used to describe the location of the object in the data model.Download the Java EE Management Specification from/aboutJava/communityprocess/final/jsr077/index.htm l.2.1.1JMO HierarchyThe data model organizes JMOs hierarchically in a tree structure. The root JMO isJ2EEDomain, which represents a collection of Web application server instances that are logically related. J2EEDomain contains the object names for all instances of theJ2EEServer JMO, each of which represents a server instance in the collection.Java applications can browse the hierarchy of JMOs, recursively querying for object names and looking up the JMOs that are named by the query results.2.1.2JMO Object NamesEach JMO instance is identified by a unique object name of typejavax.management.ObjectName. The names follow this pattern:domain:name=j2eeType=value,name=value,parent-j2eeType[,property=value]*For example, mydomain:J2EEtype=J2EEDomain,name=mydomainThe Java EE Management Specification describes exactly which name/value pairs must be in the object names for each JMO type.The object name for each child JMO contains name/value pairs from its parent JMO's object name. For example, if the JMO for a server instance is namedmydomain:j2eeType=J2EEServer,name=myserverthen the JMO for a servlet that is part of an application deployed on that server instance would be named:mydomain:J2EEApplication=myapplication,J2EEServer=myserver,WebModule=myapp_ mywebmodule,j2eeType=Servlet,name=myservlet_nameThe name/value pairs can appear in any order.2.1.3Optional Features of JMOsThe Java EE Management Specification, version 1.0, requires only that Web application servers implement JMOs and provide API access to the JMOs.Optionally, you can implement the JMOs to provide performance statistics, management operations, and to emit notifications when specified events occur.2.1.4Accessing JMOsA Java application accesses the JMOs throughjavax.management.j2ee.Management, which is the remote interface for the Management Enterprise Java Bean (MEJB).The Java EE Management Specification requires that the MEJB's home interface be registered in a server's JNIDI tree as ejb.mgmt.MEJB.See the API Reference for the javax.management.j2ee package:/javaee/6/docs/api/javax/management/j2ee/pack age-summary.html.2.2The Java EE Management Model on WebLogic ServerAs of version 9.0, WebLogic Server implements only the required features of the Java EE Management Specification, version 1.1. Therefore, the following limitations are in place:■None of the JMOs provide performance statistics, management operations, or emit notifications.■There are no mappings to the Common Information Model (CIM).■There are no mappings to an SNMP Management Information Base (MIB).The MEJB and JMOs are available only on the Administration Server. This is consistent with the Java EE Management Model, which assumes that most Java EE Web servers exist within some logically connected collection and that there is a central point within the collection for accessing or managing the server instances. From the Administration Server, a Java application can browse to the JMO that represents any resource on any server instance in the WebLogic Server domain.Because WebLogic Server implements its JMOs as a wrapper for its MBeans, any changes in a WebLogic Server MBean that corresponds to a JMO is immediately available through the Java EE Management APIs.For all JMO object names on WebLogic Server, the domain: portion of the object name corresponds to the name of the WebLogic Server domain.2.3Accessing the MEJB on WebLogic ServerTo retrieve monitoring data through the MEJB:1.Look up the javax.management.j2ee.ManagementHome interface throughthe Administration Servers JNDI tree under the name ejb.mgmt.MEJB.e ManagementHome to construct an instance ofjavax.management.j2ee.Management, which is the MEJB's remote interface.2.3.1Example: Querying Names of JMOsThe example class in accesses the MEJB for a WebLogic Server domain and invokes javax.management.j2ee.Management.queryNames method. This method returns the object name for all JMOs in the domain.Example 1Querying Names of JMOsimport java.io.IOException;import .MalformedURLException;import java.util.Iterator;import java.util.Set;import java.util.Properties;import javax.management.j2ee.Management;import javax.management.j2ee.ManagementHome;import javax.management.AttributeNotFoundException;import javax.management.InstanceNotFoundException;import javax.management.ObjectName;import javax.management.QueryExp;import javax.naming.Context;import javax.naming.InitialContext;import javax.naming.NamingException;import javax.ejb.CreateException;public class GetJMONames {static String url = "t3://localhost:7001";static String user = "weblogic";static String password = "weblogic";public static void main(String[] args) {try {getAllJMONames();}catch(Exception e){System.out.println(e);}}public static Management getMEJBRemote()throws IOException, MalformedURLException,NamingException,CreateException{Context context = getInitialContext();ManagementHome home = (ManagementHome)context.lookup("ejb.mgmt.MEJB");Management bean = home.create();return bean;}public static Context getInitialContext()throws NamingException{Properties p = new Properties();p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");p.put(Context.PROVIDER_URL, url);if (user != null) {p.put(Context.SECURITY_PRINCIPAL, user);if (password == null)password = "";p.put(Context.SECURITY_CREDENTIALS, password); }return new InitialContext(p);}public static void getAllJMONames(){try {Management rhome = getMEJBRemote();String string = "";ObjectName name = new ObjectName(string);QueryExp query = null;Set allNames = rhome.queryNames(name, query);Iterator nameIterator = allNames.iterator();while(nameIterator.hasNext()) {ObjectName on = (ObjectName)nameIterator.next();System.out.println(on.getCanonicalName() + "\n");}} catch (Exception ex) {ex.printStackTrace();}}}3ConventionsThe following text conventions are used in this document:4Documentation AccessibilityOur goal is to make Oracle products, services, and supporting documentation accessible to all users, including users that are disabled. To that end, ourdocumentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Accessibility standards will continue to evolve over time, and Oracle is actively engaged with other market-leadingtechnology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For more information, visit the Oracle Accessibility Program Web site at /accessibility/.Accessibility of Code Examples in DocumentationScreen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on anotherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.Accessibility of Links to External Web Sites in DocumentationThis documentation may contain links to Web sites of other companies ororganizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites.Access to Oracle SupportOracle customers have access to electronic support through My Oracle Support. For information, visit /support/contact.html or visit /accessibility/support.html if you are hearing impaired.Oracle Fusion Middleware Monitoring and Managing With the Java EE Management APIs for Oracle WebLogic Server, 11g Release 1 (10.3.3) E13736-03ConventionMeaning boldfaceBoldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary.italicItalic type indicates book titles, emphasis, or placeholder variables for which you supply particular values.monospace Monospace type indicates commands within a paragraph, URLs, codein examples, text that appears on the screen, or text that you enter.Copyright © 2007, 2010, Oracle and/or its affiliates. All rights reserved.This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.。

诺瓦科技LED同步控制系统MCTRL R5用户手册英文版

诺瓦科技LED同步控制系统MCTRL R5用户手册英文版

H C E
T L ., CO
. D
M CT R L R 5 Use r Mau al
1 Appearance
Front Panel
① : indicates status of R5 indicators: Blue indicator keeps on → normal; Red indicator keeps on → alarm; Orange indicator keeps on → No signal; Blue breathing light keeps on → standby. ② :OLED, A liquid crystal display and an operation screen
X
N A I'
N
O
S A V
R A T
T
H C E
T L ., CO
. D
Table of Contents
1 Appearance������������������������������������������������������������������������������������������������� 1
Front Panel���������������������������������������������������������������������������������������������������������������������� 1 Back Panel����������������������������������������������������������������������������������������������������������������������� 1

基于Grails的在线自适应测试系统的设计与实现

基于Grails的在线自适应测试系统的设计与实现
v 区 中 , 种 框 架 ( t t、S r g Hbrae等 ) 于 繁 冗 a社 各 Sr s p n 、 i nt u i e 过 的 配 置及 匮乏 的 A I 档 阻 碍 了快 速 的 We 发 。基 于 敏 P文 b开 捷 开 发 思 想 设 计 的 G a s 是 建 立 在 Jv rf 就 t aa平 台 之 上 的一 个
第20 第2月 l 9年 l 5卷 6期 0
开放 教 育研 究
Op n Ed ain Re e rh e uc to s ac
Vo . 5, 1 1 No. 6 De 2 0 e. 0 9
基于 Gas i 的在线自适应测试系统的设计与实现 rl
杨 进 中 吴伟 民
20 0 8年推 出 10版 , . 目前 的稳定版 本是 1 11版 , .. 值得 一提
的 是 该 版 本 增 加 了 对 G ol 计 算 平 台 G g p n n og e云 o l A pE  ̄ e e 的支 持 ( ohr2 0 ) ri 是 一 个 面 向 企 业 级 应 用 、 于 R ce,0 9 。G a s l 基 MV C模 式 构建 于 S r gH bra 、 ur p n 、 ient Q at StM s 流 行 i e z和 i eh等 e 的开 源 框 架 之 上 的一 站 式 ( ls c )We 架 , 中 Hbr flt k u —a b框 其 i — e nt 为 G a s 供 “ 象一 系 映 射 ” O jc R linl p ae ri 提 l 对 关 ( b t e t a Ma— e ao
e dpi et简称 C T 。例 如 G E、 O E r a teT s, A v A ) R T F L等 考 试 都 采 取 了计 算 机 自适 应测 试 的形 式 ( 张华 龙 ,04 。 20 ) 本 研 究 采 用 G a s 架 设 计 实 现 的 一 个 自适 应 测 试 系 ri 框 l

Grails框架在数字电视用户管理系统中的应用

Grails框架在数字电视用户管理系统中的应用

久层( e iec ) 事务 ( r s tn 的支持 ; Prs ne , st Ta a i ) n co 提供 了 We C框 架 的 实现 , 对 于一 些 常 用 的企 业 bMV 并 服务 A IA p ctnItf e 提供 了一致 的模型 P ( plao e a ) i i n rc 封装, 是一 个全方 位 的应用 程 序 框架 J 。这 些 框 架
的出现 , 一定 程度上 方便 了 Jv E的使 用 , 高 从 aaE 提
是这个原则并不真正地要抛弃配置 , 约定” 在“ 不能 满足程序需要的情况下 , 仍然可以使用配置进行有 效 的补 充 。 在 创建 Gas rl框架 的应用 时 , ri 会 自动创 建 i Gas l

了使用 J a E开发的效率 , a vE 可是它们使用起来仍 然 比较繁琐, 它们要么需要编写大量的配置文件 , 要 么需要扩展指定的接 口, 这种使用上 的复杂性有时
业 应用 。平 台 自推 出 以来 , 就受 到 We 发人 员 b开
视用户 管 理 系统 ( usr e ngm n Ss m, S bcbrMaae et yt 简 i e 称 S S 是数 字 电视 建设 和业 务开 展必 不 可 少 的关 M) 键 系统 … , 广 电部 门办理 数 字 电视 业 务 的基 础 和 是
( 黄河科技学院南区现代教育技 术中心 , 郑州 4 06 ) 5 0 3

要 :Jv E是 目前使 用最 为广泛 的 We 用 开发 平 台,然 而 ,Jv E 包含 了一 套 非常 复 aaE b应 aaE
杂 的规 范 ,不容 易学 习掌握且 开发 效率 较低 ,虽然 网络社 区 内不 断 出现 的各 种基 于 Jv E的 开 aaE

grails_isoft

grails_isoft

Grails简介
总体框架图 Grail是一套用于快速Web应用开发的开源框架,它基于Groovy编程语言,并构建于Spring、 Hibernate和其它标准Java框架之上,从而为大家带来一套能实现超高生产力的一站式框架
Grails环境配置
2.1 下载和安装 让Grails运行起来的第一步是安装发行包。请按照如下步骤: 下载 Grails的二进制发行包并解压到你指定的目录下 新增 GRAILS_HOME 环境变量并指向你解压发行包时选择的目录 Unix/Linux系统上通常在你的profile文件中添加 export GRAILS_HOME=/path/to/grails 来设置环境变量 Windows系统上则是在 我的电脑/属性/高级/环境变量 中添加相同的环境变量 现在需要添加 bin 目录到 PATH 环境变量中: Unix/Linux系统上在profile中继续添加 export PATH="$PATH:$GRAILS_HOME/bin" Windows系统上修改 我的电脑/属性/高级/环境变量 中的 Path 环境变量
Grails简介
Grails是构建在现有的像Spring、Hibernate这样的Java技术之上。 Grails是个一栈式开发框架,它尝试通过核心技术和插件技术来解决许多Web开发难题。Grails包含了如下内 容: 由 Hibernate 构成的易于使用的 Object Relational Mapping (ORM)层 称为 Groovy Server Pages (GSP) 的展现层技术 基于 Spring MVC 的控制层 由基于 Groovy 的 Gant 工具构建的命令行脚本环境 一个内嵌的 Jetty 容器被配置用来快速重载应用 Spring容器内建的依赖注入技术 基于 Spring 的 MessageSource 核心概念的国际化 (i18n) 支持 基于 Spring 的抽象事务概念的事务服务层 Grails使用“约定优于配置”原则来配置自己。

Eclipse 下Grails环境搭建步骤

Eclipse 下Grails环境搭建步骤

Eclipse下的Grails开发环境搭建详解听说Eclipse对Grails支持不是很好,相反,IntelliJ和NetBeans都比Eclipse要好。

IntelliJ我是没用过,不好发表什么看法,不过经过这两天对Eclipse和NetBeans在开发Grails项目上的试用,发现确实NetBeans使用起来要方便一点。

这是一句比较客观的话,因为本身我自己大部分时间还是一个Eclipse使用者。

那么下面我们就进入正题:1. Grails环境安装不管用NetBeans还是Eclipse,都需要这一步,即首先将Grails下载下来,并安装好。

Grails官网是:/下载链接:/Download这一步很简单,相信大家都不会有什么问题。

只是有一个细节必须得提一下,那就是GRAILS_HOME环境变量的设置问题,它必须与你所设置的PATH变量(添加了%GRAILS_HOME%\bin目录之后的那个PATH)在同一个级别上。

要么都是用户级变量,要么都是系统级变量。

我这里全部设置在用户级变量下,如图:之后,运行cmd,输入grails命令,回车,如果能够显示一条帮助信息,那么表示这一步成功完成。

(我这里使用的版本是Grails 1.0.3)2. Eclipse安装这里也只有一点需要说明:因为Grails开发是需要编辑gsp文件的,它实际上就是一个使用了一些特殊标签的jsp文件,而Classic版本的 Eclipse不带有jsp编辑器,所以建议下载JEE版本的Eclipse。

当然,如果你觉得你对JSP语法太熟悉了,完全可以不用它的JSP 编辑器,而且你机器内存实在太小的话,可以考虑用Classic版本。

下面将以最新的Eclipse 3.4.0 JEE版本为例。

3. 安装Groovy Eclipse插件其官方网址是:/Eclipse+Plugin下载地址是:/groovy/distributions/update/GroovyEclipse.zip像一般的Eclipse插件安装一样,可以选择用Software Update安装或用link的方式进行安装,在我之前的博客中详细介绍过Eclipse插件安装的问题,而且网上资料也很多,这里就不详细讲了。

AP常用命(7)

AP常用命(7)
copy_to_flash kernel1 0x2000000 0 ;V3 copy_to_flash addr 0x2000000 0xbed00000 0xe00000;
//OS下升级OS命令
cd /tmp && tftp -g 192.168.100.101 -r AQWAREn1.2.22.1.bin
set bootcmd '$(namedfree)$(namedalloc) bootm 0x10040000 productplatform=apv14 ethspd=1000;' V2 11N,非11n去掉 ethspd=1000(1000M电口参数)
saveenv
reb
--------------------------------------------------------------------------
---------------------------------------------------------------------------
//V2 11n产品
wifi0[11ng]:
wlanconfig ath0 destroy
wlanconfig ath0 create wlandev wifi0 wlanmode ap
/---------------------------------------------------------------------------/
/所用平台通用部分
/---------------------------------------------------------------------------/

flyway 配置规则

flyway 配置规则

flyway 配置规则Flyway 配置规则Flyway 是一个开源的数据库版本控制工具,可以帮助开发人员管理和追踪数据库结构的变化。

通过简单的配置,开发人员可以轻松地使用 Flyway 来管理数据库的迁移。

1. 安装和配置我们需要将 Flyway 添加到项目的依赖中。

可以通过 Maven、Gradle 或者手动下载 jar 包的方式来获取 Flyway。

然后,在项目的配置文件中添加数据库连接相关的配置,包括数据库的 URL、用户名和密码等信息。

2. 创建迁移脚本在项目的迁移目录下创建一个新的 SQL 脚本文件,用于存放数据库的变更脚本。

每个脚本文件都应该按照特定的命名规则来命名,以便 Flyway 能够按照正确的顺序执行这些脚本。

一般情况下,脚本文件的命名规则是以版本号和描述信息组成,例如V1__Create_table.sql。

3. 执行迁移执行迁移是使用 Flyway 最重要的功能之一。

通过命令行工具或者在应用程序启动时自动执行迁移,可以确保数据库的结构与代码的版本始终保持一致。

在命令行中执行 flyway migrate 命令,或者在应用程序中调用 Flyway 的 API 来执行迁移。

4. 版本控制Flyway 提供了一套简单的版本控制机制,用于管理数据库结构的变化。

每个迁移脚本都有一个对应的版本号,Flyway 会根据版本号的顺序来执行这些脚本。

当有新的脚本需要执行时,Flyway 会自动检测并执行这些脚本。

5. 回滚迁移如果在执行迁移过程中发生了错误,或者需要撤销之前的变更,Flyway 提供了回滚机制。

通过命令行工具或者在应用程序中调用Flyway 的 API,可以回滚到指定的版本或者撤销最近的迁移。

6. 脚本管理Flyway 提供了一套脚本管理机制,用于管理迁移脚本的生命周期。

可以通过命令行工具或者在应用程序中调用 Flyway 的 API 来管理迁移脚本的状态,包括标记脚本为已应用、已删除或者已忽略等。

IDE配置以及Graf组态说明

IDE配置以及Graf组态说明

IDE配置以及MOXGraf组态说明1.IDE配置1.1新建工程打开IDE,首先参考《现场采集站配置》来决定新建IDE配置是OC的还是RTU的。

项目名称如上所示。

1.2新建站点首先通过点击来新建OC站点,在General中设置如下所示:(IP默认,DNP先不做设置)如果是RTU,点击图标添加站点,在General中设置如下所示:1.2新建CP接下来点击来添加CP,参考《现场采集站配置》选择型号MX602-30101.3新建IO Module然后点击来添加卡件,参考《现场采集站配置》,所有采集模块型号AI:MX603-0308-613DI:MX603-0108-113根据具体的机柜配置来决定添加的卡件数量以及AI和DI的排列顺序硬件配置弄好后可以把卡件信息导入到对应的MOXGraf工程中。

点击“Browse”来找到对应的Moxgraf工程,然后点击“Export”进行倒入卡件信息。

(需要关闭Moxgraf工程)2.MOXGraf组态2.1新建工程打开MOXGraf,然后新建工程:这里注意模版类型:OC的选择:MoxStandardPrjRTU的选择:MoxRTUStandardPrj 2.2网络设置点击图标进入网络设置,鼠标右击选择Insert Network,出现如下对话框默认ETCP,点击确定。

鼠标左健按在Config1上,然后拖动鼠标到ETCP上面,弹出以下对话框输入下载程序的控制器IP地址(这边先默认)点击图标回到之前的页面。

2.3冗余设定如果是OC控制器需要进行冗余设定。

RTU的不需要做冗余设定鼠标右击”Resource1”→“Properties”→Extended设置如下所示(IP先默认)2.4功能块复制打开例子工程,然后打开功能块”AI2Eng”,然后复制所有程序。

关闭此工程,打开新建的Graf 工程,在“function block”添加“ST“功能块,然后复制程序。

关闭程序窗口然后重新命名功能块名称为”AI2Eng”,然后保存。

grails的环境搭建

grails的环境搭建

1、下载jdk和grails可以去官网下Jdk:/technetwork/java/javase/downloads/index.htmlGrails:/doc/latest/guide/gettingStarted.html#requirements在C盘新建一个文件夹dev,将下载下来的两个文件夹jdk和grails放置进去。

2、配置环境(1)配jdk安装Jdk以后,打开我的电脑(右键)->属性->高级->环境变量->系统变量中添加以下环境变量(假定你的Jdk安装在C:\dev):JAVA_HOME=C:\dev\Jdkclasspath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;(.;一定不能少,因为它代表当前路径)path=%JAVA_HOME%\bin测试JVM安装是否正常在开始->运行中输入cmd然后回车,在DOS窗口下输入java–version,如果显示类似如下,表示Jdk安装成功:(2)配grails环境变量Windows系统上右击“我的电脑”/“属性”/“高级”/“环境变量”,点击新建环境变量GRAILS_HOME,值为C:\dev\grails-2.1.0Windows系统上右击“我的电脑”/“属性”/“高级”/“环境变量”,修改path的值,在最后面增加%GRAILS_HOME%\bin;测试Grails安装是否正常打开window命令提示符窗口,输入grails,看到测试成功!!3、第一个grails程序最终效果常见dos命令Quit退出cd dev前往文件夹cd..回退到上级文件夹最关键的几句代码grails create-app helloworld 创建文件夹cd helloworld来到文件夹grails run-app运行启动应用程序。

PRTXB系列RTD温度传感器说明书

PRTXB系列RTD温度传感器说明书

PRTXB SeriesRTD Process ThermometersM-4998/0818Thermowell required for spring-loaded versionsRange and Resolution User selectable °F, °C or K –58.0°F to 392.0°F –50.0°C to 200.0°C 220.0K to 475.0K 0.1 degree resolutionTypical AccuracyIncludes linearity error and ±1 LSD 11-point linearization ±0.7°C at –50°C ±0.4°C at 0°C ±0.9°C at 100°C ±1.4°C at 200°CDisplay4 readings per second nominal display update rate 4 digit LCD, 0.5" H,5 character 0.25" H alphanumeric BL models: red LED backlightSensorIEC-751 Class B 100 Ω Platinum RTD, 0.00385 alpha curve 1/2" NPT male, 316 stainless steelSpring-loaded probe versions fit standard thermowells Fixed probe pressure rating: 5000 psi max. Fixed probes are welded to hex fittingAuto Shutoff TimeFactory default 5 minutes. User settable to 1, 2, 5, 10, 15, 20, 30 minutes, 1, 2, 4, 8 hours, or manual on/off.OFF warning before auto shutoff to allow reset of timer Batteries, Battery Life, Low Battery Indication B: 2 AA alkaline, approx. 1000 hoursBL: 2 AA alkaline, approx. 150 to 750 hours depending on backlight usage.BL: Button press activates backlighting for 1 minute Low battery symbol on displayControls and FunctionsThree front buttons for power on/off, min/max functions, selection of °F, °C, or K, auto shutoff times, calibration and, configuration optionsUser-defined pass codes for configuration and calibration to prevent unauthorized changesMaximum and Minimum ReadingsUser-configurable maximum and/or minimum temperature indication. Factory default configuration MAX/MIN disabled.Choice of MAX only, MIN only, MAX/MIN, or noneOption to retain or clear MAX/MIN temperatures at shutoff Out-of-RangeALARM1 under range indication on display ALARM2 over range indication on displayCalibrationUser settable pass code required to enter calibration mode Zero and span temperature calibrationNon-interactive zero, span, and linearity, ±10% of range Weight Product: 12 ounces (approximately) Shipping:1 pound (approximately)HousingABS/polycarbonate NEMA 4X case, polycarbonate label, rubber rear gasketConnection, Material, Media Compatibility 1/2" NPT male fitting, 316L stainless steel All wetted parts are 316L stainless steelThermowell required for spring-loaded versions Storage Temperature –40 to 203°F (–40 to 95°C)Operating Range–4 to 185°F (–20 to 85°C) at housingX X X X X 88888indicatione-mail:**************For latest product manuals: Shop online at User’s GuideWARNING: This product can expose you to chemicals including lead, nickel and chromium, which are known to the State of California to cause cancer or birth defects or other reproductive harm. For more information go to DescriptionThe PRTXB series is microprocessor controlled industrial RTD temperature indicator with a digital temperature display in a rugged NEMA 4X housing.The temperature reading is linearized for the digital display. The temperature display may be set up to read °F, °C, or kelvin and the auto shutoff time may be set as needed.The unit is capable of automatically capturing and storing maximum and maximum readings. The min/max functionality can be set up as required, and the readings can be either saved or cleared when the unit shuts off.Installation and PrecautionsRead these instructions before installation. Configuration may be easier before installation.The spring-loaded versions must be used with a thermowell. Use a thermowell appropriate for the process.The non-spring-loaded versions can be used in non-pressurized applications or applications with no flow. Due to the hardness of 316 stainless steel, it is recommended that a thread sealant be used to ensure leak-free operation.Do not exceed maximum allowable housing temperature. Install or remove using wrench on probe hex fitting only. Do not attempt to tighten or loosen by turning the housing.OperationPress and release the power button to power up the unit. The unit tests all LCD segments and displays the RTD temperature on the upper display and the temperature units on the lower display. Readings are updated approximately 4 times per second.The RTD probe has a time constant of approximately 10 seconds, typical of an RTD probe in a stainless sheath. Time constant is characterized as the RTD changing to 63.2% of its new temperature span in one time constant, and 95% of its new temperature span in three time constants.If the unit is configured with an auto shutoff time, a five second warning period is provided prior to auto shutoff, during which the display indicates OFF. The auto shutoff timer is reset whenever any button is pressed and released.To shut off the unit manually at any time, press and hold the power button until the display indicates OFF (up to about 5 seconds total if MAX/MIN is enabled) and then release the button.Out-of-Range IndicationsIf the RTD temperature goes above 392°F or 200°C, ALARM1 will be displayed.If the RTD temperature goes below –58°F or –50°C, ALARM2 will be displayed.If the RTD temperature continues beyond these limits, the display will eventually indicate 1.-.-.-.MAX/MIN Operation (if enabled)The factory default setting has min/max disabled. To turn this feature on, see the section titled User Configuration Mode. The unit may be configure to use max, min, neither, or both.To step the unit through the display modes, press and hold the power button about 1 second until the display indicates MAX or MIN and then release the button. The display mode cycle repeats through the following steps.MAX ModeThe display indicates the stored maximum reading and the lower display alternates between indicating MAX and the temperature units. The thermometer may be left in this mode if desired.User Configuration ModeWith the unit off, press and hold the s button.Then press the power button.Release all buttons when the display indicates CFG.Before the unit enters the configuration mode, the display initially indicates _ _ _ _ with the first underscore blinking, and with CFGPC on the lower display.The unit will automatically revert to normal operation if no buttons are operated for approximately 15 seconds. To cancel and return to normal operation, press and release the power button without entering any pass code characters.Enter the user-modifiable configuration pass code (3510 factory default).Use the s and tbuttons to set the left-most digit to 3.Press and release the power button to index to the next position. The 3 will remain, and the second position will be e the s and t buttons to select 5.Press and release the power button to index to the next position. 3 5 will remain, and the third position will be e the s and t buttons to select 1.Press and release the power button to index to the next position. 3 5 1 will remain, and the fourth position will be e the s and t buttons to select 0.Press and release the power button to proceed with configuration procedures. Note: If an incorrect pass code is entered, the unit will return to the start of the pass code entrysequence.MAX/MIN Capture Configuration The upper display will be blank.Use the sand t buttons to select from the following.MX/MN Both highest and lowest values willbe capturedMX/-- Only highest value will be captured --/MN Only lowest value will be captured --/--Capture feature is disabledPress and release the power button to move on to the next parameter.Auto/Manual MAX/MIN Clearing The upper display will indicate clr.Use the s and t buttons to select from the following.AUTO Maximum and minimum values willautomatically be cleared whenever the unit shuts off.MANMaximum and minimum values will be retained and must be cleared manually as desired.Press and release the power button to save the user configuration and restart the unit.ALARM 1ALARM 2DEG FX X X X X 88888keep onto turn offttRelease buttonsIncrement Move to Increment Move to Press to enter con-t*Select min Press to save and Select auto or Press to save andrestartCalibrationThe PRTXB is factory calibrated and there is generally no need to alter calibration settings. Required calibration equipment includes a temperature reference of at least four times the unit’s accuracy, a dry-block calibrator or a temperature controlled bath.Calibration may be performed in any of the available temperature units, the use of Fahrenheit or Celsius is assumed in this procedure. Select the temperature units for calibration prior to entering the calibration mode.The unit enters and remains in the calibration mode until restarted manually or power is removed. While in the calibration mode, the auto shutoff timer is disabled, and the Min/Max feature is disabled.The unit is calibrated at two points, at ice point and at a temperature above ice point.For general service, the full scale temperature is normally used for the second point. However, if a particular temperature is of critical interest it may be used instead for greatest accuracy at that point.Enter Calibration ModeTo enter the calibration mode, begin withthe unit powered off, and press and hold thet button.Then press the power button.Release all buttons when the displayindicates CAL.Before the unit enters the calibration mode,the display initially indicates _ _ _ _ with thefirst underscore blinking, and with CALPC onthe lower display.Note: The unit will automatically revert tonormal operation if no buttons are operatedfor approximately 15 seconds.To cancel and return to normal operation,press and release the power button withoutentering any pass code characters.Enter the user-modifiable pass code (3510factory default).Use the s and t buttons to set the left-most digit to 3.Press and release the power button to indexto the next position. The 3 will remain, andthe second position will be blinking.Use the s and t buttons to select 5.Press and release the power button to indexto the next position. 3 5 will remain, and thethird position will be blinking.Use the s and t buttons to select 1.Press and release the power button to indexto the next position. 3 5 1 will remain, andthe fourth position will be blinking.Use the s and t buttons to select 0.Press and release the power button toproceed with calibration.Note: If an incorrect pass code is entered, theunit will return to the start of the pass codeentry sequence.Calibration ProcedureUpon successful pass code entry, theupper display will indicate the RTD probe temperature. The lower display will alternateas indicated below.Note: To store the calibration parametersand exit calibration mode at any time, pressand hold the power button until the displayindicates - - - -.Ice-Point CalibrationWhen the applied temperature is belowapproximately 12 °C (or 54 °F), the unit willautomatically select the ice-point calibrationmode.Apply 0.0 °C or 32.0 °F to the RTD.The lower display will alternate between ICEand DEG C or DEG F.Use the s and t buttons to adjust the upperdisplay to indicate 0.0 °C or 32.0 °F.Span CalibrationApply full-scale temperature to the RTD.The lower display segments will alternatebetween CAL and DEG C or DEG F.Use the s and t buttons to adjust the upperdisplay segments to indicate the appliedtemperature value.To store the calibration parameters and exitcalibration mode, press and hold the powerbutton until the display indicates - - - - .Changing the Pass CodesThe factory default pass code of 3510 may be changed ifdesired. Separate pass codes may be used for min/maxconfiguration access and calibration access.Configuration Pass Code AccessWith the unit off, press and hold the sbutton.Then press the power button.Release all buttons when the displayindicates CFG.Calibration Pass Code AccessWith the unit off, press and hold the t buttonto view and/or change the user calibrationpass code.Then press the power button.indicates CAL.View/Change Pass CodeBefore the unit enters the view or changepass code mode, the display initially indicates_ _ _ _ with the first underscore blinking,and with CFG PC or CALPC on the lowerdisplay.Note: The unit will automatically revert tonormal operation if no buttons are operatedfor approximately 15 seconds.To cancel and return to normal operation,press and release the power button withoutentering any pass code characters.Enter Access Code 1220Use thes and t buttons to set the left-most digit to 1.Press and release the power button to indexto the next position. The 1 will remain, andthe second position will be blinking.Use the s andt buttons to select 2.Press and release the power button to indexto the next position. 1 2 will remain, and thethird position will be blinking.Use the s and t buttons to select 2.Press and release the power button to indexto the next position. 1 2 2 will remain, andthe fourth position will be blinking.Use the s andt buttons to select 0.Note: If an incorrect access code wasentered, the unit will return to the start of theaccess code entry sequence.Press and release the power button toproceed.The display will indicate the existing user-defined pass code with CFGPC or CALPC onthe lower display. To exit without changes,press the power button.Operate the s andt button to selectthe first character of the new pass code.Characters 0-9 and A, b, C, d, E, F may beused.When the correct first character is beingdisplayed, press and release the powerbutton to proceed to the next pass codecharacter.Repeat above until the entire pass code iscomplete.To exit the view or change pass code mode,press and hold the power button.Release the button when the displayindicates - - - - to restart the unit.Press to save andrestartIncrement upor downIncrement upor down- or -cfgpci___IncrementMove toIncrementMove tonext #IncrementMove toIncrementMove toPress to enterIncrementMove toIncrementMove toPress to save andrestartPress to enter passcode configurationOMEGA’s policy is to make running changes, not model changes, whenever an improvement is possible. This affordsour customers the latest in technology and engineering.OMEGA is a registered trademark of OMEGA ENGINEERING, INC.© C opyright 2017 OMEGA ENGINEERING, INC. All rights reserved. This document may not be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form, in whole or in part, without the prior written consent of OMEGA ENGINEERING, INC.FOR WARRANTY RETURNS, please have thefollowing information available BEFORE contacting OMEGA:1. P urchase Order number under which the productwas PURCHASED,2. M odel and serial number of the product underwarranty, and3. Repair instructions and/or specific problemsrelative to the product.FOR NON-WARRANTY REPAIRS, consult OMEGA for current repair charges. Havethe following information available BEFORE contacting OMEGA:1. Purchase Order number to cover the COST of the repair,2. Model and serial number of the product, and 3. Repair instructions and/or specific problems relative to the product.RETURN REQUESTS/INQUIRIESDirect all warranty and repair requests/inquiries to the OMEGA C ustomer Service Department. BEFORE RETURNING ANY PRODUC T(S) TO OMEGA, PURC HASER MUST OBTAIN AN AUTHORIZED RETURN (AR) NUMBER FROM OMEGA’S C USTOMER SERVIC E DEPARTMENT (IN ORDER TO AVOID PROCESSING DELAYS). The assigned AR number should then be marked on the outside of the return package and on any correspondence.The purchaser is responsible for shipping charges, freight, insurance and proper packaging to prevent breakage in transit.WARRANTY/DISCLAIMEROMEGA ENGINEERING, INC. warrants this unit to be free of defects in materials and workmanship for a period of 13 months from date of purchase. OMEGA’s WARRANTY adds an additional one (1) month grace period to the normal one (1) year product warranty to cover handling and shipping time. This ensures that OMEGA’s customers receive maximum coverage on each product.If the unit malfunctions, it must be returned to the factory for evaluation. OMEGA’s C ustomer Service Department will issue an Authorized Return (AR) number immediately upon phone or written request. Upon examination by OMEGA, if the unit is found to be defective, it will be repaired or replaced at no charge. OMEGA’s WARRANTY does not apply to defects resulting from any action of the purchaser, including but not limited to mishandling, improper interfacing, operation outside of design limits, improper repair, or unauthorized modification. This WARRANTY is VOID if the unit shows evidence of having been tampered with or shows evidence of having been damaged as a result of excessive corrosion; or current, heat, moisture or vibration; improper specification; misapplication; misuse or other operating conditions outside of OMEGA’s control. Components in which wear is not warranted, include but are not limited to contact points, fuses, and triacs.OMEGA is pleased to offer suggestions on the use of its various products. However, OMEGA neither assumes responsibility for any omissions or errors nor assumes liability for any damages that result from the use of its products in accordance with information provided by OMEGA, either verbal or written. OMEGA warrants only that the parts manufactured by the company will be as specified and free of defects. OMEGA MAKES NO OTHER WARRANTIES OR REPRESENTATIONS OF ANY KIND WHATSOEVER, EXPRESSED OR IMPLIED, EXCEPT THAT OF TITLE, AND ALL IMPLIED W ARRANTIES INCLUDING ANY W ARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE HEREBY DISCLAIMED. LIMITATION OF LIABILITY: The remedies of purchaser set forth herein are exclusive, and the total liability of OMEGA with respect to this order, whether based on contract, warranty, negligence, indemnification, strict liability or otherwise, shall not exceed the purchase price of the component upon which liability is based. In no event shall OMEGA be liable for consequential, incidental or special damages.CONDITIONS: Equipment sold by OMEGA is not intended to be used, nor shall it be used: (1) as a “Basic Component” under 10 CFR 21 (NRC), used in or with any nuclear installation or activity; or (2) in medical applications or used on humans. Should any Product(s) be used in or with any nuclear installation or activity, medical application, used on humans, or misused in any way, OMEGA assumes no responsibility as set forth in our basic WARRANTY /DISCLAIMER language, and, additionally, purchaser will indemnify OMEGA and hold OMEGA harmless from any liability or damage whatsoever arising out of the use of theProduct(s) in such a manner.。

Grafana-9 部署_配置_使用

Grafana-9 部署_配置_使用

Grafana 9.2.0 使用基础目录1 . Grafana 基础安装 (2)下载安装 (2)环境配置 (3)配置设置 (3)基础配置项 (3)基础配置说明 (3)服务启动 (4)客户端工具 (4)2 . 权限配置 (5)权限概述 (5)Organizations 管理 (5)Users 管理 (5)Teams 管理 (6)操作权限管理 (6)3 . 业务数据源配置 (7)数据源简介 (7)Prometheus 数据源配置 (7)4 . 仪表盘配置(Dashboard) (7)Dashboard 简介 (7)Folder 创建 (8)Dashboard 创建 (8)5 . 告警配置 (8)A . 告警概述 (8)B . Alert Rules - 邮件规则信息配置 (9)C . Contact points - 通知终端配置 (10)D . Notification policies - 告警通知策略配置 (11)E . Silences 告警静默配置 (12)F . 告警通知实现 (13)6 . 告警模板自定义 (13)A . 邮件告警模板配置 (13)B . 企业微信告警模板配置(WeCom) (14)依赖组件版本说明:1 . Grafana 基础安装下载安装官网Github 下载地址中选择指定版本下载解压即可。

环境配置配置设置将[ conf/sample.ini ] 复制并重命名为[ custom.ini ] ,然后修改[ custom.ini ] (官方建议不要修改sample.ini) . 只需要修改[ custom.ini ]中需要变更的配置即可,不需要变更的配置会默认加载[ defaults.ini ]配置文件的默认配置, 其实大多数配置如果不需要都会使用[ defaults.ini ]文件,所以该文件很重要不要随意修改 .基础配置项app_mode = production[paths]data = D:/grafana/test/grafana/datalogs = D:/grafana/test/grafana/log[server]root_url = [ your grafana url ][database]type = mysqlhost = [ your database url ]name = grafanauser = testpassword = 123456[ smtp ]enabled = truehost = [ your email url ]user = [ email account ]password = [ email password ]from_address = [ from email account ]基础配置说明app_mode :配置运行环境 . 可选值为production/development , 默认production .data : 配置临时存储目录 . 用于存储临时文件/会话文件/sqlite3数据文件(如果配置了sqlite存储的话)logs : 配置日志存储目录 .root_url : 配置的grafana 服务的访问地址 . 这个地址也会作为告警等其他提示信息中所发送的本机访问地址.type : 配置系统存储数据源类型 . 可选mysql/postgres/sqlite3 .host : 数据源地址加端口 .name : 数据库名称 .user : 数据源用户 .password : 数据源密码 .enabled : 启用smtp 邮件发送配置 .host : 配置smtp 邮件发送地址加端口 .user : 配置smtp 邮件发送账号 .password : 配置smtp 邮件发送密码 .from_address : 配置smtp 邮件发送发件人配置 .服务启动可以通过[ grafana-server.exe --help ]查看启动帮助提示 .[ grafana-server.exe -config D:/grafana/grafana-9.2.0/conf/custom.ini -pidfile D:/grafana/test/grafana/pid/grafana.pid ]启动命令中指定了配置文件和pid文件位置(在linux环境下最好指定这些参数,防止默认生成位置并不适用的问题)服务启动完成后访问地址为: 配置项[ root_url ].服务启动完成后默认的用户名密码是[ admin / admin ],登录时会提示重设密码可选跳过或重设(可以在自动生成数据库中的user表中查看用户列表) .客户端工具重置管理员密码:./grafana-cli admin reset-admin-password admin123列出帮助文档:grafana-cli --help列出指定命令帮助文档:grafana-cll admin --help2 . 权限配置权限概述Grafana 的权限功能一共分为Organizations(组织)、Teams(团队)、Users(用户) ,三级管理 .Organizations 相当于公司的概念(下称Org) .Teams 则相当于公司的下的某个团队 .Users 则存在于公司和团队之下的个体用户 .同样的权限的管理也可以针对这三级来管理, 但是为了方便管理一般建议创建明确的组织、团队、用户阶层, 以便方便授权管理 .TIPS : 所有权限管理操作都是基于Org 的范围来管理的, 所以无论是使用Admin 用户还是其他用户, 在操作之前一定要确认当前所在的Org 是否是需要操作的Org 下, 否则就不是对指定Org 下的权限管理操作了 . 可将鼠标悬浮在已登录用户的图标上即可查看当前所在Org 的名称, 或者点击已登录用户的图标, 在右侧[ Preferences ]面板的Org 区域选择切换到指定的Org 下即可 .Organizations 管理[ Server admin ] -> [ Organizations ] : 点击New Org 按钮创建新的组织数据, 填写完成即可创建 .将Admin 切换到新创建的Org 组织下 .Users 管理[ Server admin ] -> [ 已登录用户] : 点击New user 按钮创建新的用户数据, 填写完成即可创建 .创建后在信息面板中Org 区域点击[ Add user to organization ]按钮将当前用户添加到指定组织结构下 .Teams 管理[ Configuration ] -> [ Teams ] : 点击New Team 按钮创建新的团队数据, 填写完成即可创建 .创建后在信息面板中Members 区域点击[ Add member ]按钮添加当前Org 下的指定用户到当前Teams .(注意:当前Org 归属)操作权限管理Grafana 的所有信息相关的数据全部与Org 绑定, 所以权限设置也是以Org 为单位, 不同的Org 之间的所有数据均不可见 . 但是同一个Org 下的所有信息都是可见的, 可以选择默认展示Dashboard 和用户是否编辑等权限.Org 权限设置[ Configuration ] -> [ Preferences ] : 可以设置当前Org 的默认Dashboard / UI Theme / Timezone / Week start 等信息 .Teams 权限设置[ Configuration ] -> [ Teams ] : 选择需要设置的Team ,点击[ Setting ] Tab页即可设置默认Dashboard / UI Theme / Timezone / Week start 等信息 .User 权限设置:[ Configuration ] -> [ Users ] : 可以选择对应用户的Role ,以设置该用户是否具有查看、编辑、管理员权限等信息 .3 . 业务数据源配置数据源简介业务数据源是用于配置Grafana 采集指标数据来源的配置 . Grafana 通过已配置好的业务数据源可以采集指定的通过该类型数据源的指标数据到Grafana 进行显示、查询和监控等等. 业务数据源的类型非常多, 比如: 时序数据库类->[ Prometheus / InfluxDB / OpenTSDB ] , 分布式采集类->[ Tempo / Zipkin ] , 云上服务->[ Azure Monitor / Grafana Cloud ] , 关系型数据库->[ MySQL / PostgresSQL ] 等等 .Prometheus 数据源配置创建路径: [ Configuration ] -> [ Data sources ] -> [ Add data source ](初次使用可能没有该按钮,而是创建Tab卡,点击即可新建)name : 填写当前Prometheus 数据源业务名称 .[HTTP] URL : 填写Prometheus 数据源地址 .[Alerting] Scrape interval : 设置数据拉取频次(默认:15s) .[Alerting] Query timeout : 设置数据查询超时(默认:60s) .点击[ Save & Test ]按钮即可保存并查看Test 结果 .4 . 仪表盘配置(Dashboard)Dashboard 简介Dashboard 是Grafana 最常用的可视化组件, 它可以将采集的所有指标信息按照指定的运算规则进行展示, 方便进行数据查询、查询、监控等等操作 .Folder 创建为了更好的管理Dashboard 的分组, 在使用Dashboard 之前需要先创建存储Dashboard 的目录 . 点击[ Dashboard ] -> [ New folder ] 即可创建一个folder .然后可以在[ Dashboard -> Browse ]浏览列表中查看该folder结构,然后鼠标悬浮该folder 后显示[ Go to folder ]即可直接跳转至该folder 内,会展示该folder 内所有的Dashboard 列表 .Dashboard 创建在folder 目录下点击右侧[ New ]按钮选择[ New Dashboard ]即可创建Dashboard 对象, 也可以点击已有的Dashboard 进入, 即可修改当前Dashboard 信息 .5 . 告警配置TIPS :1 . 此处以邮件告警为例演示告警通知功能, 此前请确认smtp 配置已完成 .2 . 此处以采集一个随机整数指标为示例来说明告警信息配置 .3 . Grafana 不支持对包含模板变量的查询进行监控(这个有待考证) .A . 告警概述Grafana 模块(v9.2.0版本)包含六个功能:Alert Rules : 告警规则信息配置 . 用于配置告警触发规则 .Contact points : 告警通知终端配置 . 用于配置告警通知方式 .Notification policies : 告警通知策略配置 . 用于配置告警触发规则和告警通知方式的匹配关系(通过label 来匹配) .Silences : 告警静默策略配置 . 用于配置告警静默时段段, 已配置在静默模式下的告警规则则不会触发告警通知消息 .Alert groups : 告警分组配置 . 暂未确定用法 . (暂未使用)Admin : 告警模板管理配置 . 预览当前整个告警模块的配置模板信息 . (暂未使用)Grafana 支持对于指标信息的各种告警配置, 且告警渠道支持Alertmanager / Dingding / Email / Microsoft Teams 等等终端 .B . Alert Rules - 邮件规则信息配置1 . Set a query and alert condition在该区域是设置告警数据来源条件的地方 . 可以通过[ Add query ]和[ Add expression ]来创建查询和表达式等对象来生成告警数据 . 这里每添加一个Query 或者Expression 对象时, 会默认分配一个代号, 默认从"A"开始依次递增, 这个代号在整个区域中可以通过$A 或者${A} 方式来引用(后者是当代号有特殊字符时使用, 一般用$A 即可) .此处以采集一个随机数指标为例, 通过判断指标最后上传时间(push_time_seconds)在2m (指标上传间隔为5s) 内未更新的条件下则触发告警信息 .> 首先, 创建一个查询 A , 设置指标表达式为: increase(push_time_seconds{job="self_metrics"}[2m]) . increase 函数是计算指定指标在指定时间间隔的差值, 此处就是计算job="self_metrics"} 在每2m 时间跨度上的push_time_seconds 指标的差值 .> 然后, 创建一个表达式B , 用Operation = Reduce 操作来收集A 查询中的结果到当前表达式上 . 表达式内容为[ Operation=Reduce , Function = Last , Input = A , Mode = Strict(严格模式) ] . 这样就将A 的最后一个结果收集到B 表达式上来 .> 最后, 创建一个表达式C , 用于判断表达式B 的结果是否满足判断条件, 从而决定是否触发告警设置 . 表达式内容为[ Operation=Math , Expression = "$B == 0" ] . 这样表达式C 就是可以实时判断2m 内是否有上传指标数据上来 .在设置完数据源查询表达式后, 在[ Set alert conditoin ]区域选择最后的表达式结果C , 从而以C 表达式的结果为准 .2 . Alert evaluation behavior在该区域是设置告警监控规则的设置 . 可以设置监控频率、时间范围、空数据及错误数据处理、预览告警查询计算结果等等 .Evaluate every : 10s for 1m . 表示每10s 采集一次监控数据, 持续采集周期为1m . 这个周期对于告警计算非常重要 .告警规则有三个状态Normal / Pending / Alerting . 告警会以Evaluate every 参数一为频率来检测告警数据, 告警检测结果为正常时它处于Normal 状态, 当它遇到第一个异常结果时它处理Pending 状态, 在持续收到检测数据在Evaluate every 参数二时间内之内均为异常数据时, 它的状态会切换为Alerting , 此时告警机制会通过Notification policies 配置查找Contact points 终端, 然后通过该终端发送告警通知 . 如果在Evaluate every 参数二时间之内又恢复了正常数据, 则会由Pending 状态转为Normal 状态 . 只有当告警规则的状态为Alerting 状态时才会发送告警通知, 其他状态均不会触发通知 .Configure no data and error handling : 用于配置在无检测数据输入或告警状态获取异常情况下的处理情况 . 无数据输入情况下可选择[Alerting、No Data、OK]三种处理策略, 获取状态异常情况下可选择[ Alerting、OK、Error]三种处理策略 .3 . Add details for your alert在该区域是设置告警详细内容的信息 .Rule name : 告警规则名称 .Folder : 告警规则存储目录 .Group : 告警规则归属分组(没有则会默认自动新建) .Suumary and annotations : 告警预览信息 . 这些信息在某些告警终端会予以显示(比如:邮件) .这里可以设置系统默认Summary(概述) / Runbook URL(辅助信息地址) / Description(描述) / Dashboard UID(仪表UID) / Panel ID(面板ID) / 自定义信息 .如设置了Runbook URL / Dashboard UID / Panel ID , 则可以在邮件告警通知中出现[ View Runbook ]/[ Go to Dashboard ]/[ Go to Panel Source ]等操作按钮 .Dashboard UID & Panel ID 可以通过在Dashboard Settings 页面的[ JSON Model ]栏确认并获取到 .4 . Notifications在该区域可以简单查看Grafana 的告警处理流程说明, 并且可以配置告警Labels 信息 . 在后续关联告警规则和通知终端的配置中(Notification policies)会使用Labels 作为关联依据, 所以这个要特别注意 .这里的Labels 是作为告警识别判断的依据, 所以建议在这里单独设置告警Labels 信息, 而不要借用业务指标数据中的Labels(groupingKey) 信息, 这样容易让业务和告警配置混淆 .C . Contact points - 通知终端配置1 . Choose Alertmanager这里是用于选择Grafana 告警管理服务, 简单说就是告警发生后对接到哪个服务来进行后续处理 . 常用有grafana / alertmanager server 等 .一般如果没有额外部署Alertmanager Server 服务, 则默认使用Grafana Server 来默认处理告警信息 .2 . Message Templates这里用于设置告警信息模板, 如果设置生效后, 当产生告警信息后会以预设模板样式将告警信息发送至告警终端 .3 . Contact Points这里用于设置告警终端设置 . 通过[ New contact point ]设置来新增告警终端, 填写告警通知终端名称/ 告警通知终端类型/ 告警通知终端参数/ 可选参数设置/ 通知设置(是否通知已处理) 等设置 .D . Notification policies - 告警通知策略配置1 . Choose Alertmanager该区域基本和[ Contact points ]的[ Choose Alertmanager ]作用相同 .2 . Root policy该区域是用于设置默认顶级告警通知关联设置(告警顶级路由节点) , 意思就是系统默认的告警通知关联设置 . 所有告警信息都会由该顶级路由节点进入路由树, 该路由树必须匹配所有告警, 然后遍历子节点 . 所以这个Root policy 就相当于默认一定要经过的告警通知关联设置 .3 . Specific routing该区域是用于设置告警通知关联设置的区域 . 只有当对告警规则和告警通知终端二者设置了告警通知关联设置, 当告警触发时才会通过指定告警通知终端来下发告警信息 .通过[ New Policy ]来新增告警通知关联设置 . 然后点击[ Add matcher ]添加匹配规则, 将Labels 信息符合要求的告警规则关联到该设置后续所设置的告警通知终端上来, 从而实现告警下发 .通过[ Contact point ]选择要设置的告警通知终端设置 .通过[ Continue matching subsequent sibling nodes ] 选择告警规则在命中当前告警关联设置后是否继续匹配路由树节点中后续的其他告警通知关联设置 . 默认false .通过[ Override grouping ] 选择对命中告警规则进行重分组 . 如果它为空则默认集成父类告警分组 . 默认为false .通过[ Override general timings ] 选择对命中告警规则的时间功能设置 .[Group wait]告警通知发送等待时间 . 即告警第一次触发后等待多久发送一组告警通知 . 如果立刻发送就尽量设置短一点 .[Group interval]分组内每个告警通知(包含触发/解除告警)发送间隔 . 该值会影响同组下所有告警通知发送间隔,且含触发和解除通知的间隔.比如:该值设置为20m,则触发通知发出后需要至少20m后才会发送解除通知(哪怕该告警已立刻解决).所以不建议过长.[Repeat interval]告警成功通知后的重发时间间隔 . 同一告警重发发送间隔, 此值不建议设置太低, 否则会频繁收到告警通知邮件 .通过[ Mute timings ] 选择告警静默时间设置 . 该设置可以在已设置静默规则的列表中选择针对当前告警通知关联规则的静默设置 . 如果设置了静默规则, 则该告警关联规则在静默时段内不会下发告警信息到告警通知终端 . 该项设置来源于<4 . Mute timings >设置项TIPS :1 . 建议设置[Group Wait]时间为1s , 这样可以减少Grafana 的告警通知下发触发等待时间, 默认值很慢, 其他时间不用修改默认值即可 .2 . 经过测试针对[ Override general timings ]参数效果如下:+ [Group wait] 决定触发告警下发时间间隔,如:1s,就表示告警触发后立刻下发通知.+ [Group interval] 决定同组下触发告警和解除告警发送时间间隔,如:1m,就表示触发告警发出后至少在1m后才会发送解除告警(假设告警在10s就已解除).+ [Repeat interval] 决定单个告警下发最低时间间隔,不过这个参数需要集合[Group interval]一起生效,因为单个告警肯定是同组,所以假如[Group Interval]=5s,[Repeat Interval]=10s,则单个告警重发的实际时间间隔为15s.而解除告警通知则仅受[Group interval]影响.4 . Mute timings该区域用于设置静默规则设置 . 用于提供给告警关联规则决定在静默时间范围内不会下发告警信息到告警通知终端 . 这个设置相对简单, 不做赘述 .E . Silences 告警静默配置该区域是用于对已经设置的告警规则进行静默设置 . 就是不让告警规则下发告警通知到告警通知终端(注意:是不下发告警,并不会阻止任何告警状态的变化) .点击[ New Silence ]然后选择静默时间段设置, 然后设置与告警规则关联的Labels (这点与告警通知关联设置相同) , 最后保存当前告警静默设置即可生效 .可以在静默设置列表中已生效的静默设置进行解除, 同样也可以对已经失效的静默设置进行重建 .F . 告警通知实现> DingDing 告警 .首先在钉钉群添加机器人助手, 然后复制其WebHook 地址到Grafana 中设置Contact Point 选择DingDing , 配置好DingDing 机器人助手的推送策略即可 .注意: 检查WebHook 地址前后不能包含空格 .> EPWeChat 告警 .在企业微信群添加机器人助手, 然后复制WeHook 地址到Grafana 中设置Contact point 选择WeCom 即可 .> 邮件告警 .在Contact point 选择Email 类型,然后会使用配置文件中配置的[ smtp ]设置来进行邮件发送设置 .6 . 告警模板自定义TIPS :1 . 告警模板可以通过{{ define "name" }}方式定义模板内容, 然后在其他位置使用{{ template "name" . }}方式来调用自定义模板.2 . 模板语法中要注意变量的作用域问题,全局变量可以在任意位置调用如{{ .ImageURL }},但是循环体变量则必须在range循环体内才能调用.如{{.Annotations.SortedPairs}}内变量等等.A . 邮件告警模板配置在使用邮件告警功能时, 请先确认Grafana 配置文件(linux:grafana.ini / windows:custom.ini)中是否已开启STMP 相关配置 .从配置文件中的[ emails ] -> [ templates_pattern ]配置项可以确定邮件通知模板的位置, 一般无需修改这个配置 .默认邮件通知会使用[ ./public/emails/ng_alert_notification.html ]模板, 这个是使用指定格式内置表达式写的邮件模板, 如果需要对邮件模板进行定制可以对此文件进行重写即可 .具体变量使用方法可以参考下面企业微信自定义模板的语法来设置即可.B . 企业微信告警模板配置(WeCom)在Contact point 的[ Optional WeCom settings ]设置中设置Message 的内容如下即可, 这个是基本和上述邮件模板展示指标内容相同, 可自定义删减:{{ if gt (len .Alerts.Firing) 0 }}[FIRING]监控告警- {{ range .Alerts.Firing }} ({{ .Labels.alertname }}) {{ end }}{{ end }}{{ if gt (len .Alerts.Resolved) 0 }}[RESOLVED]告警解除- {{ range .Alerts.Resolved }} ({{ .Labels.alertname }}) {{ end }}{{ end }}-------- Preview --------{{ if gt (len .GroupLabels.SortedPairs) 1 }}{{ range .GroupLabels.SortedPairs }}{{ .Name }} : {{ .Value }}{{ end }}{{ end }}{{ range .Alerts.Firing }}-------- Details --------Value : {{ .ValueString }}{{ end }}-------- Annotation --------{{ range .Alerts.Firing }}{{ if gt (len .Annotations.SortedPairs) 0 }}{{ range .Annotations.SortedPairs }}{{ .Name }} : {{ .Value }}{{ end }}{{ end }}{{ end }}{{ range .Alerts.Resolved }}{{ if gt (len .Annotations.SortedPairs) 0 }}{{ range .Annotations.SortedPairs }}{{ .Name }} : {{ .Value }}{{ end }}{{ end }}{{ end }}-------- Labels --------{{ range .Alerts.Firing }}{{ if gt (len .Labels.SortedPairs) 0 }}{{ range .Labels.SortedPairs }}{{ .Name }} : {{ .Value }}{{ end }}{{ end }}{{ end }}{{ range .Alerts.Resolved }}{{ if gt (len .Labels.SortedPairs) 0 }}{{ range .Labels.SortedPairs }}{{ .Name }} : {{ .Value }}{{ end }}{{ end }}{{ end }}-------- Link --------{{ range .Alerts.Firing }}{{ if .Annotations.runbook_url }}Runbook : {{ .Annotations.runbook_url }}{{ end }}{{ if .PanelURL}}Panel : {{ .PanelURL }}{{ end }}{{ end }}{{ range .Alerts.Resolved }}{{ if .Annotations.runbook_url }}Runbook : {{ .Annotations.runbook_url }}{{ end }}{{ if .PanelURL}}Panel : {{ .PanelURL }}{{ end }}{{ end }}----------------------- end -----------------------。

elasticsearch-java8控制台打印dsl语句 -回复

elasticsearch-java8控制台打印dsl语句 -回复

elasticsearch-java8控制台打印dsl语句-回复如何在Elasticsearch中使用Java8控制台打印DSL语句Elasticsearch是一个基于Lucene的分布式搜索和分析引擎,广泛用于构建实时搜索、日志分析和大数据分析等场景。

它提供了丰富的查询API,允许用户通过DSL(Domain Specific Language,领域特定语言)来构建复杂的查询语句。

在开发过程中,我们经常需要调试和验证构建好的查询语句是否符合预期,这时候一个方便的方式是通过控制台打印出生成的DSL语句,以便人工检查和调试。

本文将介绍如何在Java8中使用Elasticsearch的API 来实现这个功能。

步骤一:导入Elasticsearch依赖首先,在我们的Java项目中需要导入Elasticsearch的依赖。

如果你使用的是Maven构建项目,可以在pom.xml文件中添加以下依赖:xml<dependency><groupId>org.elasticsearch.client</groupId><artifactId>elasticsearch-rest-high-level-client</artifactId><version>7.15.1</version></dependency>这个依赖包含了Elasticsearch的高级REST客户端,它提供了丰富的API用于与Elasticsearch的集群进行交互。

步骤二:创建Elasticsearch客户端接下来,我们需要创建一个Elasticsearch客户端实例,用于与Elasticsearch集群建立连接并执行查询。

创建一个名为ElasticsearchClient的类,并在该类中添加如下代码:javaimport org.elasticsearch.client.RestClient;import org.elasticsearch.client.RestHighLevelClient;public class ElasticsearchClient {private RestHighLevelClient client;public ElasticsearchClient() {client = new RestHighLevelClient(RestClient.builder(new HttpHost("localhost", 9200, "http")));}public RestHighLevelClient getClient() {return client;}}上述代码创建了一个名为ElasticsearchClient的类,并在构造函数中初始化了一个高级REST客户端实例。

grafana的sqlserver模板

grafana的sqlserver模板

Grafana 是一个流行的开源监控和可视化工具,可以用于分析和展示各种系统的性能数据。

Grafana 支持多种数据源,包括SQL Server 数据库。

以下是在Grafana 中配置SQL Server 模板的步骤:1. 安装和配置SQL Server确保你已经在你的系统中安装了SQL Server,并且已经创建了一个数据库来存储你想要监控的数据。

2. 安装Grafana你可以从Grafana 的官方网站上下载并安装Grafana。

安装完成后,打开Grafana 的Web 界面。

3. 配置数据源在Grafana 的配置页面中,选择“数据源”选项卡,然后点击“添加数据源”。

在“类型”下拉菜单中选择“sqlserver”,然后在“连接详细信息”中填写以下信息:* 名称:给你的数据源起一个名称。

* 数据库URL:这是SQL Server 的连接字符串。

例如:`sqlserver://username:password@localhost:1433/instance_name`。

其中username 和password 是你的SQL Server 凭据,localhost 是SQL Server 的主机名,1433 是SQL Server 的端口号,instance_name 是SQL Server 的实例名称。

* 数据库驱动程序:选择与你的SQL Server 版本对应的驱动程序。

例如,如果你的SQL Server 是2019 年版本,则选择“mssql 4.x”。

* 默认数据库:这是你想要连接的默认数据库名称。

4. 导入SQL Server 模板在Grafana 的主界面中,点击“导入”按钮,然后在“模板”下拉菜单中选择“SQL Server”。

在下一个页面中,选择你想要使用的SQL Server 模板,然后点击“下一步”。

在接下来的页面中,填写以下信息:* 数据库URL:这是你在上一步中配置的数据源的连接字符串。

[转载]grails调用存储过程(Grails: calling a stored procedure)

[转载]grails调用存储过程(Grails: calling a stored procedure)

[转载]grails调用存储过程(Grails : calling a stored procedure)在特殊情况下,grails应用需要调用数据库的存储过程,这在grails的官方文档里边好像没有提到过,在james的blog里介绍如何解决这个问题。

代码转贴如下java 代码1.class MainController {2.3. def dataSource // using the datasource we define in the spring's resources.xml4.5. def index = {6. Sql sql = new Sql(dataSource)7. def row = sql.execute("call create_daily_hours(${new Date()+1})")8. }9.}需要说明的一些是:grails本身没有提供访问存储过程的便捷方法,而groovy 的GSQ L提供了,因此grails可以直接拿过来用了,当然也可以用spring的JdbcTemplate。

希望对grails用户有点用。

原文地址:/group/blog/86666My experience with grails is getting richer the longer I use it for web application developing. It's very nice that grails is built on top of spring framework which we can take advantage of. I am not a spring user before but with a help from the nice people at the grails forum I was able to achieve what I want to do.Calling a stored procedure from a MySQL database or any other database is simple. First we need a datasource which spring could provide for us. I have the following code place in the resources.xml found in the spring folder in your grails folder.<bean id="dataSource" class=" mons.dbcp.BasicDataSource "><property name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property><property name="url"><value>jdbc:hsqldb:hsql://localhost</value></property><property name="username"><value>sa</value></property><property name="password"><value></value></property></bean>I use connection pooling for better performance. In my controller here is how I use the datasource to call a store procedure.class MainController {def dataSource // using the datasource we define in the spring's resources.xmldef index = {Sql sql = new Sql(dataSource)def row = sql.execute("call create_daily_hours(${new Date()+1})") }}That's it! Notice that I am using Groovy SQL instead of Spring JDBCTemplate. It's a lot more friendlier for a beginner.Grails really makes everything easy here and provides a lot of flexibility thanks to it's nice integration with spring. From here everything is possible.原文地址:/2007/03/grails-little-of-spring-framew ork.html附:朝花夕拾——Groovy & Grailsposted on 2007-06-04 19:39 山风小子。

advanced settings翻译

advanced settings翻译

advanced settings翻译"Advanced settings" can be translated into Chinese as "高级设置" or "高级选项". It refers to a set of customizable options or configurations that offer more advanced or specialized functionalities for a particular software, device, or system. These settings are typically hidden or not immediately accessible to the average user, as they require more technical knowledge or may have the potential to affect the normal operation of the software or device.Here are some examples of how "advanced settings" can be used in both English and Chinese:1. You can access the advanced settings by clicking on the "Advanced" tab in the preferences menu.你可以通过点击偏好设置菜单中的“高级”选项卡来访问高级设置。

2. Make sure to save your work before modifying the advanced settings, as some changes may require a restart.在修改高级设置之前,请确保保存好你的工作,因为有些更改可能需要重新启动。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Learning to Relate
Demo
Conventional Thinking
Demo
More GORM Fu
Customizable fetch modes static fetchMode ww= [someOtherAttribute : ‘eager’] Composition static embedded = [‘someAttribute’] Table-per-hierarchy inheritance
Still More to Explore
Custom user types /hibernate+integration
ORM DSL <brand new!> /GORM+-+Mapping+DSL
Migrations <brand new!> /p/dbmigrate/wiki/Grails
Advanced Domain Models with Grails
Jason Rudolph jason@
Enterprise Integration Made Easy
Published under the Creative Commons Attribution Noncommercial Share Alike License Version 2.5. (Please see /licenses/by-nc-sa/2.5 for complete details.)
Learning to Relate
One-to-One
1:1 Relationships
class Knight { String name int numDragonsSlain Sword sword } class Sword { String serialNumber String manufacturer
Rock-Solid Foundation
DAO
Demo
Dynamic Persistence Methods
save delete get addTo... removeFrom... withTransaction list findAll findBy... count exists etc.
Introduction
Jason Rudolph Grails Committer Principal @ Relevance Author
Agenda
The case for GORM Conventional thinking, unconventional productivity Relationships, any way you like ‘em Constraints, declare and be done GORM for non-conformists Hibernate mappings EJB3 annotations Going further with GORM
}
1:1 Relationships
class Knight { String name int numDragonsSlain Sword sword } class Sword { String serialNumber String manufacturer Knight knight }
1:1 Relationships
Resources
Downloads Latest release (0.6) Development snapshot (1.0-RC1) User guide, tutorials, screencasts, etc. Mailing lists (/mailing+lists)
Demo
EJB3 Step-by-Step
Start with Java 5 (or higher) Update DataSource.groovy configClass = wwGrailsAnnotationConfiguration.class Add POJOs to src/java Define hibernate.cfg.xml Drop in constraints (optional)
A Groovier Solution
Demo
Going Further with GORM
GORM outside of Grails /gorm+-+standalone+gorm
Java on GORM /page/ie?entry=java_on_grails
Demo
Hibernate XML - Step-by-Step
Define Hibernate artifacts Add hibernate.cfg.xml Prepare HBM file for each deviant table Consider reverse engineering with Hibernate tools Create Grails domain classes Add constraints (optional)
Declaring Constraints
Pre-packaged constraints blank creditcard email inList min max matches nullable range unique url etc.
Custom constraints Influence schemas and scaffolding
DAOs Considered Harmful
Grails Object-Relational Mapping (GORM) Zero-configuration persistence management Rich relationship model Declarative validation Powerful query support Easy scaffolding
Wisdom of Crowds
Many-to-Many
m:n Relationships
class Knight { //... static hasMany = [battles:Battle] static belongsTo = Battle }
class Battle { //... static hasMany = [knights:Knight] }
Hibernate Tools /255.html
Slides & Examples Available @ /downloads
Please Fill Out Your Evaluations
This presentation is published under the Creative Commons Attribution Noncommercial Share Alike License Version 2.5. (Please see /licenses/by-nc-sa/2.5 for complet?
Standards-based POJOs Reuse elsewhere Not tied to Grails Full power of GORM (once again) Dynamic persistence methods Constraints Scaffolding
Expanding Our Horizons
One-to-Many
1:n Relationships
class Knight { //... static hasMany = [swords:Sword] }
class Sword { //... Knight knight static belongsTo = Knight }
Resources (cont’d)
GORM Documentation /gorm
Grails Podcast - Episode 18 svenhaiges.de/space/start/2006-11-24/1
Resources (cont’d)
Grails + EJB3 Tutorial /articles/grails-ejb-tutorial
The Power of Constraint
Demo
Defying Conventional Wisdom
Non-conforming table/column names Custom sequences Complex keys Advanced mappings
No Schema Left Behind
class Knight { String name int numDragonsSlain Sword sword } class Sword { String serialNumber String manufacturer Knight knight static belongsTo = Knight }
Why Hibernate XML?
Standard Hibernate artifacts Reuse your existing mappings Full power of GORM Dynamic persistence methods Constraints Scaffolding
Pimp My EJBs
相关文档
最新文档