go to post Eduard Lebedyuk · Jun 8, 2021 There's a standard method for it: write ##class(%PopulateUtils).Integer(min, max) If you're okay with 0 as a first digit you can use: write $tr($j($random(10000),4)," ", 0) Note, that $random is preudo-random, if you require strictly random values you should use the GenCryptRand() method of the %SYSTEM.Encryption class.
go to post Eduard Lebedyuk · Jun 8, 2021 I would like to know if I can move only user database or default databases as well?? All databases can be moved what sort of permission do I need to change for new directory path irisusr should have RW access to the folder. The easiest way is to check what access (owner, group, permissions) is set for existing files/folders and then recreate the same in a new location. and what all files I need to copy at new location?? IRIS.DAT and stream subfolder if it exist. Please suggest if modification in iris.cpf file can do this all operation Absolutely.
go to post Eduard Lebedyuk · Jun 8, 2021 It's not IRIS related. %PrimaryRequestHeader is defined in Ens.BusinessProcess and so not available for BO/BS. Use %RequestHeader property, available in BS and BO.
go to post Eduard Lebedyuk · Jun 5, 2021 1. Install InterSystems IRIS. 2. Shut it down. 3. Open <iris>/iris.cpf, there you will find: [Databases] USER=C:\InterSystems\IRIS\Mgr\user\ [Journal] AlternateDirectory=C:\InterSystems\IRIS\Mgr\journal\ CurrentDirectory=C:\InterSystems\IRIS\Mgr\journal\ [config] wijdir=C:\InterSystems\IRIS\Mgr\WIJ 4. Edit this file as you wish and move the corresponding directories. 5. Start InterSystems IRIS.
go to post Eduard Lebedyuk · Jun 4, 2021 Thank you. Looks like exactly what I need. Does DSW3 work with pivot variables?
go to post Eduard Lebedyuk · Jun 4, 2021 %CELL is exactly what I need: SELECT NON EMPTY { [DateOfSale].[Actual].[YearSold].&[2016], [DateOfSale].[Actual].[YearSold].&[2017], %LABEL(%CELL(-1,0) / %CELL(-2,0), "YTY", "#%;") } ON 0, NON EMPTY [Product].[P1].[Product Name].Members ON 1 FROM [HOLEFOODS]
go to post Eduard Lebedyuk · Jun 2, 2021 It's perfectly fine to have %DynamicObjects properties and they are persisted.
go to post Eduard Lebedyuk · Jun 1, 2021 --node-type m6.2xlarge \ m6g.2xlarge probably? Great article!
go to post Eduard Lebedyuk · May 27, 2021 If you're talking about drawn connections: They are defined in OnGetConnections method, check what does it do: /// Return an array of connections for drawing lines on the config diagram ClassMethod OnGetConnections(Output pArray As %String, pItem As Ens.Config.Item) { } That said, the drawn connections and this method are just visual docs. Developers are expected to provide this method and keep it relevant but in no way are they beholden to do it. The only way to know what does any BH do is to go through the code or visual trace.
go to post Eduard Lebedyuk · May 21, 2021 What's your linefeed symbol? Also you have a string, not a stream. Anyway, try this: set nl = $$$NL set str = "2334" _ nl _ "3434" _ nl _ "5543" _ nl _ "4334" for i = 1:1: $length(str, nl) { set value = $piece(str, nl, i) write value, ! }
go to post Eduard Lebedyuk · May 19, 2021 %xsd.base64Binary is essentially a string so you can't write more than 3,5 mb there. Change property definition to %Stream.GlobalCharacter instead.
go to post Eduard Lebedyuk · May 19, 2021 Global buffers are one of the keys to performance. Yes, that's why if streams are to be stored in the db they should be stored in a separate db with distinct block size and separate global buffers.
go to post Eduard Lebedyuk · May 18, 2021 There are a lot of considerations. Questions: Can you describe what are you going to do with that streams (or files I guess)? Are they immutable? Are they text or binary? Are they already encrypted or zipped? Average stream size?
go to post Eduard Lebedyuk · May 18, 2021 Replace: do fileStream.Rewind() while 'fileStream.AtEnd { set tsRequest.DocumentData = tsRequest.DocumentData_fileStream.Read(30000) } with do tsRequest.DocumentData.CopyFrom(fileStream) or even: do tsRequest.DocumentData.CopyFrom(pRequest.Stream)
go to post Eduard Lebedyuk · May 4, 2021 Some time ago I was working on the issue of a fast data generation for an arbitrary data model. Data model was connected (object properties) and so to generation was going in stages from low-cardinality independent tables (i.e. product) to high-cardinality dependent tables (i.e. orders). Furthermore tables did not have continuous IDs, there were gaps (due to sharding in my case but even if there's no hard delete we might want to exclude soft deleted rows). Here's the approach I used. 1. For a given class build a local with all ranges of IDs: /// d ##class().Ranges() ClassMethod Ranges(class As %Dictionary.Classname, Output ranges) { kill ranges set table = ##class(%CSP.UI.Portal.SQL.Home).Quoter2(##class(%DeepSee.Utils).%GetSQLTableName(class)) set rs = ##class(%SQL.Statement).%ExecDirect(,"SELECT ID FROM " _ table _ " ORDER BY ID ASC") do rs.%Next() set start = rs.ID set end = rs.ID while rs.%Next() { if rs.ID - 1 = end { d $i(end) } else { set ranges($i(ranges)) = $lb(start, end-start) set start = rs.ID set end = rs.ID } } set ranges($i(ranges)) = $lb(start, end-start) } This method accepts class name and returns this structure: ranges(num) = $lb(startID, length) 2. Call GetRandomInRanges method to get random ID from ranges local: /// d ##class().GetRandomInRanges() ClassMethod GetRandomInRanges(ByRef ranges) { set sum = 0 for i=1:1:ranges { set sum = sum + $lg(ranges(i),2) } set threshold = $random(sum) + 1 set sum = 0 for chunk=1:1:ranges { set sum = sum + $lg(ranges(chunk),2) quit:sum>=threshold } set val = ranges(chunk) if $listvalid(val) { if $ll(val)=2 { set val = $lg(val, 1) + $random($lg(val, 2)) } else { set:$listvalid(val) val = $lg(val, ($random($ll(val))+1)) } } quit val } This method guarantees that returned IDs would conform to the normal distribution. Ranges should be called once and GetRandomInRanges can be called as often as needed.