查找

文章
· 九月 2, 2024 阅读大约需 2 分钟

如何定位临时global在IRISTEMP数据库中占用的空间

当进程中的数据不需要持久化保存,但又需要用到global的高性能特性时,我们常常将数据保存在临时global中,也就是保存在IRISTEMP/CACHETEMP数据库中。

系统使用 IRISTEMP/CACHETEMP 数据库保存临时的数据,用户也可以进行同样的操作。

关于临时global以及IRISTEMP数据库的更多内容,可以参见文档 Temporary Globals and the IRISTEMP Database

以下情况global作为临时使用:

  1. 系统临时global (^IRIS.Temp*, ^%cspSession, ^CacheTemp*, ^Mtemp*, 等)
  2. 用户定义的 globals 映射至 IRISTEMP/CACHETEMP 
  3. 处理私有globals (^||name, ^|"^"|name, ^["^"]name,^["^",""]name,等)
  4. GLOBAL TEMPORARY 表

1和2的大小可以通过使用 ^%GSIZE 获取

USER>do ^%GSIZE
Directory name: c:\intersystems\iris\mgr\user\ => c:\intersystems\iris\mgr\iristemp\
                            // 指明iristemp 数据库的位置
All Globals? No => yes       // Yes 为显示所有globals: 34 项被选中
34 available globals
Show details?? No => No   //  No 为不显示更多信息 
Device:
Right margin: 80 =>
:

3和4  进程私有global 可以通过使用 ^GETPPGINFO 查看。

更多关于 ^GETPPGINFO 的信息请查阅文档 这里

下面的例子列出了当前进程下所有的私有globals:

 set ^||flintstones(1)="Fred"
 set ^||flintstones(2)="Wilma"
 znspace "%SYS"
 do ^GETPPGINFO("*")

另一个方法用于输出单个进程使用较大数量的私有global:

 set ns=$namespace
 znspace "%SYS"
 // Only processes with more PPG blocks than the total number of processes are included
 set st=##class(%SQL.Statement).%New()
 set status=st.%PrepareClassQuery("%SYS.ProcessQuery","AllFields")
 set rs=st.%Execute()
 while rs.%Next() {
    set pid=rs.%Get("Pid") // Process ID
    set cnt=rs.%Get("PrivateGlobalBlockCount") // Number of PPG blocks
    // When the number of PPG blocks per process is 0 or more, the contents are output (the following example shows 20 or more blocks).
    if cnt > 20 {
       set rs2=##class(%ResultSet).%New("%SYS.ProcessQuery:PPG")
       // "N" Do not return subscripts of a PPG, just return the root name
       // "B" Return the number of blocks used by the PPG (needs the "N" option)
       do rs2.Execute("*",pid,"NB")
       for {
          quit:'rs2.Next()
          write cnt_" PID:"_pid_", PPG name "_rs2.GetData(1)_" is using "_rs2.GetData(3)_" disc blocks",!
       }
    }
 }
 
 znspace ns
讨论 (0)1
登录或注册以继续
摘要
· 九月 2, 2024

Nuevas publicaciones en la Comunidad de InterSystems, 26 agosto - 1 septiembre

26 agosto - 1 septiembreWeek at a GlanceInterSystems Developer Community
文章
· 九月 2, 2024 阅读大约需 1 分钟

Cómo descargar un archivo de imagen de un servidor web utilizando el lenguaje ObjectScript

[FAQ] Preguntas frecuentes de InterSystems

El siguiente código descarga https://www.intersystems.com/assets/intersystems-logo.png y guarda el archivo como c:\temp\test.png.

Es necesario definir una configuración SSL llamada SSLTEST antes de ejecutar este código.

 

ClassMethod download() As %Status
{
    Set sc = $$$OK
    Set httprequest=##class(%Net.HttpRequest).%New()
    set httprequest.Port = 443
    set httprequest.Https = 1
    set httprequest.SSLConfiguration = "SSLTEST"
    Set httprequest.Server="www.intersystems.com"
    Do httprequest.Get("/assets/intersystems-logo.png")
    Set httpresponse=httprequest.HttpResponse
    Set file=##class(%File).%New("c:\temp\test.png")
    Do file.Open("NWUK\BIN\")
    Do file.CopyFrom(httpresponse.Data)
    Do file.Close()
    Return sc
}
讨论 (0)1
登录或注册以继续
文章
· 九月 2, 2024 阅读大约需 1 分钟

Helm Uninstall InterSystems - What does it do?

Say I want to uninstall the IKO - all I need to do is:

> helm uninstall intersystems

What happens behind the scenes is that helm will uninstall what was installed when you ran :

> helm install intersystems <relative/path/to/iris-operator>

In some sense - this is symmetric to when we ran install - however with a different image.

You'll notice that when you install, it knows what image to take from:

operator:
  registry: containers.intersystems.com
  repository: intersystems/iris-operator-amd
  tag: 3.7.13.100

For uninstall the image to take note of is:

cleaner:
  registry: appscode
  repository: kubectl
  tag: v1.14

as referenced in your values.yaml.

Some clients have had trouble uninstalling when their cluster is not connected to the internet, because this image is missing from their registry. What occurs then, is that we have to go and delete the objects that were created via the templates folder, referenced here, and these two secrets:

intersystems-iris-operator-amd-apiserver-cert
sh.helm.release.v1.intersystems.v1

To avoid this just push the cleaner image to your repository. You can find the newest image here (make sure to push the image you reference in values.yaml).

Hope this helps!

讨论 (0)1
登录或注册以继续
问题
· 九月 2, 2024

<PROTECT> *Function not allowed in IRIS Native python

Hello Community,

I got the PROTECT error while running functions. But, I could able to call the classmethods and methods in class definition with classMethodObject, classMethodValue etc.. from python. without any errors
python code

irispy.functionString('fnString','IRISPython',14)
irispy.function('fnString','IRISPython',14)
raise RuntimeError(error_message)
RuntimeError: <PROTECT> *Function not allowed
IRISPython.mac
fnString(fn1) public {
  quit "Hello "_fn1
}

7 Comments
讨论 (7)2
登录或注册以继续