SlideShare a Scribd company logo
1 of 7
Download to read offline
Binary Instance Loading



                                                      Version 1.0
                                                    July 14, 2011




PathMATE Technical Notes



                                              Pathfinder Solutions

                                          www.pathfindermdd.com

                                                   888-662-7284




          ©2011 by Pathfinder Solutions
Table Of Contents
1.   Introduction .......................................................................................... 1

2.   Feature Details...................................................................................... 1
     User Selection ........................................................................................ 1

     Data Format ........................................................................................... 1

3.   Marking Rules ....................................................................................... 3

4.   Creating and Using Binary Instance Data .............................................. 3
     File Creation ........................................................................................... 4

     Binary Instance Data Transmission ............................................................ 4

5.   Feature Implementation Impact Areas ................................................. 4
     System Router........................................................................................ 4

     Domain Loader ....................................................................................... 4

     Class CreateFromBinaryData Method.......................................................... 5

     Linking Methods...................................................................................... 5

     File Reader............................................................................................. 5

     Interprocess Message Routing................................................................... 5

     pfdsocket.hpp......................................................................................... 5

6.   ISSUES, QUESTIONS AND OPEN DISCUSSION ....................................... 5
     SW Domain ............................................................................................ 5




Technical Note: Binary Instance Loading
www.pathfindermdd.com




1. Introduction
This Technical Note outlines binary instance data loading capabilities. Creation of
instances for PIM domain classes is a key capability for PI-MDD systems, and
different systems – and even different domains within a system – require different
solutions to meet the overall functional and performance requirements. The binary
instance data can be sent to the application as a socket-based stream, or loaded via
a process-local file.

Binary instance loading provides the most concise data format and best performance
for loading and inter-processor transport of large instance populations.


2. Feature Details
       User Selection
The binary instance loading feature is enabled by marking classes and associations
with the BinaryInstanceData property. Setting this to “TRUE” will generate
appropriate binary instance data packet routing code at the system and domain
levels, and instance creation and linking methods at the PIM class level.

       Data Format
           Records
Binary instance data is organized into a record format. These records may be sent
via tcp/ip socket message and are recognizable to the standard PfdProcess
interprocess message receiver, which routes them to the system dispatcher.

           General Record Format
             type     domain #       contents       EOR marker
   value    1 to 4   <domain #>      <varies>      0XEEEEEEEE
 # bytes       1         2            varies            4
A binary instance data record has a byte for the type (1 to 4), a domain number, the
contents, and then 4 bytes used as an inter-record marker. While the code
producing or consuming a record intrinsically knows its contents, a marker is
provided as a second check to aid in detecting corrupted or incomplete data.

           Record Stream
Records are formed into a Stream that contain the Class Instance Records and Link
Records for a single domain. A Record Stream starts with a Population Record, and
ends with a Population Complete Record.

Records are conveyed via files or inter-process messages. A Record Stream can be
grouped into one or more Record Blocks, where a Record Block is an individual file or

Technical Note: Binary Instance Loading                                                1
www.pathfindermdd.com




    message containing one or more whole records. Streams and Blocks are subject to
    these constraints:

              The first record of a Stream must be a Population Record

              The last record of a Stream must be a Population Complete Record

              All records in a Stream must be for the same domain

              A Block must contain complete records only.

                    Population Record
          value          1            <domain #>       <count>          0XEEEEEEEE
          # bytes        1                2                4                   4

    This record indicates the total number of class instances that are to be loaded for
    this specified domain from this Stream (via the full set of records, regardless of
    blocking). This allows the domain’s binary instance loader to allocate an
    appropriately sized instance id-to-pointer table.

    The instance id-to-pointer table is an array of pointers used to retain the information
    needed to rapidly process Link Records. A simple array of PfdObject* (the base class
    for all modeled classes), it has one entry for each instance in the Stream. It is
    created when a Population Record is processed, and deallocated when a Population
    Complete Record is processed.

                    Class Instance Record
value               2        <domain #>        <class #>         <instance id #>     <attribute values>       0XEEEEEEEE
# bytes             1             2                2                    4                  varies                 4

    This record contains the attribute values for the specified class instance. The
    address of the newly created instance is stored in the transient instance id-to-pointer
    table for subsequent Link Records. This table is indexed by instance_id, therefore
    instance ids must:

               Be unique for each instance – of any class – in this Stream

               Start at 0

               Have no gaps in the value range

    The attribute values are the serialized forms for each attribute (but without the type
    identifiers since they are known), to be retrieved with the get_<type>_from_buffer
    serialization utility functions.

                    Link Record
value               3        <domain #>       <assoc #>    <part. 1 instance id>     <part. 2 instance id>     0XEEEEEEEE

    Technical Note: Binary Instance Loading                                                               2
www.pathfindermdd.com




# bytes             1                  2               2                    4                        4                4

    This record contains the information to link two instances participating in an
    association. The referenced instances must have been loaded previously in this
    Stream.

                    Link Existing Instances Record

                                                               <part. 1 instance id   <part. 2 instance id
value           3           <domain #>         <assoc #>        attribute value>       attribute value>      0XEEEE
# bytes         1               2                  2                    4                      4                 4

    This record contains the information to link two instances participating in an
    association that were not necessarily part of this Stream. Each participant must
    have an indentifying attribute. The referenced instances must have been created
    before this record is processed.

                    Population Complete Record
          Value         4           <domain #>     0XEEEEEEEE
          # bytes       1                  2               4

    This record indicates all instances to be loaded via binary instance data have been
    completed. The domain loader may deallocate the instance id-to-pointer table. After
    the receipt of a Population Complete Record another population may be loaded by
    sending a new Population Record.

                    Single Domain, Whole Record Blocking
    It is generally assumed that a Block (file or message buffer) containing binary
    instance data records will only contain records for a single domain. It is also
    assumed to have whole records. That way code reading/receiving binary instance
    data records does not have to concern itself with trying to detect if a complete record
    has been read/received.


    3. Marking Rules
    Checking of the BinaryInstanceData markings ensures

              No association has BinaryInstanceData == “TRUE” unless both participants
               have BinaryInstanceData == “TRUE”.

                    o   If a supertype class has BinaryInstanceData == “TRUE” then
                        BinaryInstanceData is set to “TRUE” automatically for all subtypes


    4. Creating and Using Binary Instance Data


    Technical Note: Binary Instance Loading                                                                  3
www.pathfindermdd.com




The suggested approach for creating binary instance data files is to build a Windows
deployment of the target domain, load in the required instance data via XML and use
the generated domain and class methods to create the binary instance data file.

       Establishing the Instance Population
Use the standard XML instance file markings and run-time loading mechanisms to
create the instances needed.

       Instance Selection
Each class with has BinaryInstanceData == “TRUE” gets a Boolean data member
writeBinary_ . This is set to TRUE by default when the instance is created. It is used
in the domain method BinaryWriteCurrentPopulation.

       File Creation
Each domain with one or more classes marked with BinaryInstanceData generates a
static method BinaryWriteCurrentPopulation(String file_name). This method can be
invoked at any time and writes out a complete binary instance data stream of all
instances of class with BinaryInstanceData == “TRUE” and writeBinary_ == TRUE.
It also writes link records for all associations with BinaryInstanceData == “TRUE”
that have instances of both participants.

       Binary Instance Data Transmission
To support the transmission of Binary Instance Data the new class
PfdBinaryInstanceData is used. It is a subtype of PfdSerializable. This SW domain
uses this to make messages containing binary instance data.


5. Feature Implementation Impact Areas
       System Router
A system router method is generated when any class has its BinaryInstanceData
property set to “TRUE”. It gets a Binary Instance Data Block, checks the Domain #
in the first record and routs the block in its entirety to the appropriate domain.

       Domain Loader
A domain loader method is generated when any of its classes has its
BinaryInstanceData property set to “TRUE”. It gets the Binary Instance Data Block
and steps through it one record at a time. For a Population Record it allocates an
instance id-to-pointer table. Class Instance Records are passed into the appropriate
class instance factory advancing the next record pointer appropriately. The pointer
to the newly created instance is put in the instance id-to-pointer table. Link Records
are decomposed by the loader and the appropriate instance pointers are passed into



Technical Note: Binary Instance Loading                                              4
www.pathfindermdd.com




link methods for each participant. A Population Complete Record triggers the
deallocation of the instance id-to-pointer table.

       Class CreateFromBinaryData Method
If a class has its BinaryInstanceData property set to “TRUE” a class gets an
additional method: CreateFromBinaryData (message_buffer_t *binary_data_buffer,
int * binary_data_buffer_length). This method retrieves the attribute values from
the binary_data_buffer which has them in their serialized forms (but without the type
identifiers since they are known), retrieving them with the get_<type>_from_buffer
serialization utility functions. The binary_data_buffer pointer is incremented and the
byte count parameters is decremented for the data consumed.

After all attribute values are consumed, the binary_data_buffer is checked for an
EOR marker. If the marker is not found or any other error is encountered an error is
reported, the new instance is deleted and NULL is returned.

       Linking Methods
Standard instance linking methods are used.

       File Reader
See IDS domain below.

       Interprocess Message Routing
See IDS domain below.

       pfdsocket.hpp
Extend sw_socket_msg_type_e with SW_SOCK_MSG_BINARY_INSTANCE_RECORD.


6. ISSUES, QUESTIONS AND OPEN
   DISCUSSION
       SW Domain
We will add these services to the SoftwareMechanisms domain:

      LoadBinaryInstanceData(String binary_instance_data_file_name);

      SendBinaryInstanceData(DestinationHandle destination, String
       binary_instance_data_file_name);

We may also want to include ReadXMLInstanceData.




Technical Note: Binary Instance Loading                                              5

More Related Content

Viewers also liked

Viewers also liked (7)

Memory Pools for C and C++
Memory Pools for C and C++Memory Pools for C and C++
Memory Pools for C and C++
 
PathMATE Transformation Maps Mutx Controls
PathMATE Transformation Maps Mutx ControlsPathMATE Transformation Maps Mutx Controls
PathMATE Transformation Maps Mutx Controls
 
Distributed Deployment Model Driven Development
Distributed Deployment Model Driven DevelopmentDistributed Deployment Model Driven Development
Distributed Deployment Model Driven Development
 
Interprocess Message Formats
Interprocess Message FormatsInterprocess Message Formats
Interprocess Message Formats
 
Multi Process Message Formats
Multi Process Message FormatsMulti Process Message Formats
Multi Process Message Formats
 
Index Based Instance Identification
Index Based Instance IdentificationIndex Based Instance Identification
Index Based Instance Identification
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 

Similar to Loading binary instance data for PIM domains

Munching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processingMunching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processingabial
 
Oracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityOracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityPaulo Fagundes
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaJoe Stein
 
SQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured DataSQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured DataMichael Rys
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick GuideSourabh Sahu
 
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)confluent
 
Ch21 OS
Ch21 OSCh21 OS
Ch21 OSC.U
 
iOS Dev Happy Hour Realm - Feb 2021
iOS Dev Happy Hour Realm - Feb 2021iOS Dev Happy Hour Realm - Feb 2021
iOS Dev Happy Hour Realm - Feb 2021Jason Flax
 
Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)ukdpe
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingDibyendu Bhattacharya
 
Answer ado.net pre-exam2018
Answer ado.net pre-exam2018Answer ado.net pre-exam2018
Answer ado.net pre-exam2018than sare
 
Ixiaexplorer
IxiaexplorerIxiaexplorer
Ixiaexplorernlekh
 
Introduction to Dynamic Analysis of Android Application
Introduction to Dynamic Analysis of Android ApplicationIntroduction to Dynamic Analysis of Android Application
Introduction to Dynamic Analysis of Android ApplicationKelwin Yang
 
(130316) #fitalk bit torrent protocol
(130316) #fitalk   bit torrent protocol(130316) #fitalk   bit torrent protocol
(130316) #fitalk bit torrent protocolINSIGHT FORENSIC
 
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB
 

Similar to Loading binary instance data for PIM domains (20)

Java IO
Java IOJava IO
Java IO
 
Munching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processingMunching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processing
 
Oracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityOracle exalytics deployment for high availability
Oracle exalytics deployment for high availability
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
SQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured DataSQLBits X SQL Server 2012 Rich Unstructured Data
SQLBits X SQL Server 2012 Rich Unstructured Data
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick Guide
 
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
Dissolving the Problem (Making an ACID-Compliant Database Out of Apache Kafka®)
 
Technical presentation
Technical presentationTechnical presentation
Technical presentation
 
Active Directory Training
Active Directory TrainingActive Directory Training
Active Directory Training
 
OS_Ch21
OS_Ch21OS_Ch21
OS_Ch21
 
Ch21 OS
Ch21 OSCh21 OS
Ch21 OS
 
OSCh21
OSCh21OSCh21
OSCh21
 
iOS Dev Happy Hour Realm - Feb 2021
iOS Dev Happy Hour Realm - Feb 2021iOS Dev Happy Hour Realm - Feb 2021
iOS Dev Happy Hour Realm - Feb 2021
 
Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)
 
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark StreamingNear Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
Near Real time Indexing Kafka Messages to Apache Blur using Spark Streaming
 
Answer ado.net pre-exam2018
Answer ado.net pre-exam2018Answer ado.net pre-exam2018
Answer ado.net pre-exam2018
 
Ixiaexplorer
IxiaexplorerIxiaexplorer
Ixiaexplorer
 
Introduction to Dynamic Analysis of Android Application
Introduction to Dynamic Analysis of Android ApplicationIntroduction to Dynamic Analysis of Android Application
Introduction to Dynamic Analysis of Android Application
 
(130316) #fitalk bit torrent protocol
(130316) #fitalk   bit torrent protocol(130316) #fitalk   bit torrent protocol
(130316) #fitalk bit torrent protocol
 
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Loading binary instance data for PIM domains

  • 1. Binary Instance Loading Version 1.0 July 14, 2011 PathMATE Technical Notes Pathfinder Solutions www.pathfindermdd.com 888-662-7284 ©2011 by Pathfinder Solutions
  • 2. Table Of Contents 1. Introduction .......................................................................................... 1 2. Feature Details...................................................................................... 1 User Selection ........................................................................................ 1 Data Format ........................................................................................... 1 3. Marking Rules ....................................................................................... 3 4. Creating and Using Binary Instance Data .............................................. 3 File Creation ........................................................................................... 4 Binary Instance Data Transmission ............................................................ 4 5. Feature Implementation Impact Areas ................................................. 4 System Router........................................................................................ 4 Domain Loader ....................................................................................... 4 Class CreateFromBinaryData Method.......................................................... 5 Linking Methods...................................................................................... 5 File Reader............................................................................................. 5 Interprocess Message Routing................................................................... 5 pfdsocket.hpp......................................................................................... 5 6. ISSUES, QUESTIONS AND OPEN DISCUSSION ....................................... 5 SW Domain ............................................................................................ 5 Technical Note: Binary Instance Loading
  • 3. www.pathfindermdd.com 1. Introduction This Technical Note outlines binary instance data loading capabilities. Creation of instances for PIM domain classes is a key capability for PI-MDD systems, and different systems – and even different domains within a system – require different solutions to meet the overall functional and performance requirements. The binary instance data can be sent to the application as a socket-based stream, or loaded via a process-local file. Binary instance loading provides the most concise data format and best performance for loading and inter-processor transport of large instance populations. 2. Feature Details User Selection The binary instance loading feature is enabled by marking classes and associations with the BinaryInstanceData property. Setting this to “TRUE” will generate appropriate binary instance data packet routing code at the system and domain levels, and instance creation and linking methods at the PIM class level. Data Format Records Binary instance data is organized into a record format. These records may be sent via tcp/ip socket message and are recognizable to the standard PfdProcess interprocess message receiver, which routes them to the system dispatcher. General Record Format type domain # contents EOR marker value 1 to 4 <domain #> <varies> 0XEEEEEEEE # bytes 1 2 varies 4 A binary instance data record has a byte for the type (1 to 4), a domain number, the contents, and then 4 bytes used as an inter-record marker. While the code producing or consuming a record intrinsically knows its contents, a marker is provided as a second check to aid in detecting corrupted or incomplete data. Record Stream Records are formed into a Stream that contain the Class Instance Records and Link Records for a single domain. A Record Stream starts with a Population Record, and ends with a Population Complete Record. Records are conveyed via files or inter-process messages. A Record Stream can be grouped into one or more Record Blocks, where a Record Block is an individual file or Technical Note: Binary Instance Loading 1
  • 4. www.pathfindermdd.com message containing one or more whole records. Streams and Blocks are subject to these constraints:  The first record of a Stream must be a Population Record  The last record of a Stream must be a Population Complete Record  All records in a Stream must be for the same domain  A Block must contain complete records only. Population Record value 1 <domain #> <count> 0XEEEEEEEE # bytes 1 2 4 4 This record indicates the total number of class instances that are to be loaded for this specified domain from this Stream (via the full set of records, regardless of blocking). This allows the domain’s binary instance loader to allocate an appropriately sized instance id-to-pointer table. The instance id-to-pointer table is an array of pointers used to retain the information needed to rapidly process Link Records. A simple array of PfdObject* (the base class for all modeled classes), it has one entry for each instance in the Stream. It is created when a Population Record is processed, and deallocated when a Population Complete Record is processed. Class Instance Record value 2 <domain #> <class #> <instance id #> <attribute values> 0XEEEEEEEE # bytes 1 2 2 4 varies 4 This record contains the attribute values for the specified class instance. The address of the newly created instance is stored in the transient instance id-to-pointer table for subsequent Link Records. This table is indexed by instance_id, therefore instance ids must:  Be unique for each instance – of any class – in this Stream  Start at 0  Have no gaps in the value range The attribute values are the serialized forms for each attribute (but without the type identifiers since they are known), to be retrieved with the get_<type>_from_buffer serialization utility functions. Link Record value 3 <domain #> <assoc #> <part. 1 instance id> <part. 2 instance id> 0XEEEEEEEE Technical Note: Binary Instance Loading 2
  • 5. www.pathfindermdd.com # bytes 1 2 2 4 4 4 This record contains the information to link two instances participating in an association. The referenced instances must have been loaded previously in this Stream. Link Existing Instances Record <part. 1 instance id <part. 2 instance id value 3 <domain #> <assoc #> attribute value> attribute value> 0XEEEE # bytes 1 2 2 4 4 4 This record contains the information to link two instances participating in an association that were not necessarily part of this Stream. Each participant must have an indentifying attribute. The referenced instances must have been created before this record is processed. Population Complete Record Value 4 <domain #> 0XEEEEEEEE # bytes 1 2 4 This record indicates all instances to be loaded via binary instance data have been completed. The domain loader may deallocate the instance id-to-pointer table. After the receipt of a Population Complete Record another population may be loaded by sending a new Population Record. Single Domain, Whole Record Blocking It is generally assumed that a Block (file or message buffer) containing binary instance data records will only contain records for a single domain. It is also assumed to have whole records. That way code reading/receiving binary instance data records does not have to concern itself with trying to detect if a complete record has been read/received. 3. Marking Rules Checking of the BinaryInstanceData markings ensures  No association has BinaryInstanceData == “TRUE” unless both participants have BinaryInstanceData == “TRUE”. o If a supertype class has BinaryInstanceData == “TRUE” then BinaryInstanceData is set to “TRUE” automatically for all subtypes 4. Creating and Using Binary Instance Data Technical Note: Binary Instance Loading 3
  • 6. www.pathfindermdd.com The suggested approach for creating binary instance data files is to build a Windows deployment of the target domain, load in the required instance data via XML and use the generated domain and class methods to create the binary instance data file. Establishing the Instance Population Use the standard XML instance file markings and run-time loading mechanisms to create the instances needed. Instance Selection Each class with has BinaryInstanceData == “TRUE” gets a Boolean data member writeBinary_ . This is set to TRUE by default when the instance is created. It is used in the domain method BinaryWriteCurrentPopulation. File Creation Each domain with one or more classes marked with BinaryInstanceData generates a static method BinaryWriteCurrentPopulation(String file_name). This method can be invoked at any time and writes out a complete binary instance data stream of all instances of class with BinaryInstanceData == “TRUE” and writeBinary_ == TRUE. It also writes link records for all associations with BinaryInstanceData == “TRUE” that have instances of both participants. Binary Instance Data Transmission To support the transmission of Binary Instance Data the new class PfdBinaryInstanceData is used. It is a subtype of PfdSerializable. This SW domain uses this to make messages containing binary instance data. 5. Feature Implementation Impact Areas System Router A system router method is generated when any class has its BinaryInstanceData property set to “TRUE”. It gets a Binary Instance Data Block, checks the Domain # in the first record and routs the block in its entirety to the appropriate domain. Domain Loader A domain loader method is generated when any of its classes has its BinaryInstanceData property set to “TRUE”. It gets the Binary Instance Data Block and steps through it one record at a time. For a Population Record it allocates an instance id-to-pointer table. Class Instance Records are passed into the appropriate class instance factory advancing the next record pointer appropriately. The pointer to the newly created instance is put in the instance id-to-pointer table. Link Records are decomposed by the loader and the appropriate instance pointers are passed into Technical Note: Binary Instance Loading 4
  • 7. www.pathfindermdd.com link methods for each participant. A Population Complete Record triggers the deallocation of the instance id-to-pointer table. Class CreateFromBinaryData Method If a class has its BinaryInstanceData property set to “TRUE” a class gets an additional method: CreateFromBinaryData (message_buffer_t *binary_data_buffer, int * binary_data_buffer_length). This method retrieves the attribute values from the binary_data_buffer which has them in their serialized forms (but without the type identifiers since they are known), retrieving them with the get_<type>_from_buffer serialization utility functions. The binary_data_buffer pointer is incremented and the byte count parameters is decremented for the data consumed. After all attribute values are consumed, the binary_data_buffer is checked for an EOR marker. If the marker is not found or any other error is encountered an error is reported, the new instance is deleted and NULL is returned. Linking Methods Standard instance linking methods are used. File Reader See IDS domain below. Interprocess Message Routing See IDS domain below. pfdsocket.hpp Extend sw_socket_msg_type_e with SW_SOCK_MSG_BINARY_INSTANCE_RECORD. 6. ISSUES, QUESTIONS AND OPEN DISCUSSION SW Domain We will add these services to the SoftwareMechanisms domain:  LoadBinaryInstanceData(String binary_instance_data_file_name);  SendBinaryInstanceData(DestinationHandle destination, String binary_instance_data_file_name); We may also want to include ReadXMLInstanceData. Technical Note: Binary Instance Loading 5