Fuego Test System Projects and Initiatives Overview

Fuego Test System Projects and Initiatives Overview
Slide Note
Embed
Share

The Fuego test system projects and industry initiatives outline key features, progress, and future vision. Explore documentation conversion, LTS provisioning support, and pre-built Docker image developments. Delve into board automation standards, kernel testing, and more.

  • Fuego
  • Test System
  • Projects
  • Industry Initiatives
  • Automation

Uploaded on Apr 13, 2025 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. CSCI 5433 OBJECT ORIENTED DATABASE SYSTEMS Chapter 11 Replication [285 ~ 295] ABHISHEK REDDY REGALLA PRESENTATION ID :34

  2. Contents: Replication Example: Java. Replication with Existing Databases. The db4o Replication System. Installing dRS. Selective Replication

  3. Replication Example: Java

  4. When you start the server, it simply reports that its running. The output from the Java version is as follows: [db4o 5.2.002 2006-03-26 22:03:21] Server listening on port: '8732' SERVER:[1131461334875] Server's running... SERVER:[1131461354875] Server's running... Once the server is running, the client process or thread starts, creates, and stores two Person objects ( Bob and Alice ) CLIENT: Listing... CLIENT:[Alice;29] CLIENT:[Bob;35] Once the replicator process or thread starts, you are prompted to enter the details for a new Person, for example: REPLICATOR: Enter next surname and age (e.g. 'Tom 44'): William 21

  5. Output after one object has been replicated into the database: CLIENT: Listing... CLIENT:[William;21] CLIENT:[Alice;29] CLIENT:[Bob;35]

  6. Replication with Existing Databases Replication with Existing Databases For this first enable replication either with the GenerateUUIDs and GenerateVersionNumbers configuration, configuration method called EnableReplication as shown in the following example, and then run the defragment procedure. // C# Db4o.Configure().ObjectClass(typeof(Person)).EnableReplication(true); new Defragment().Run("db.yap", delete); or using a per-class // JAVA Db4o.configure().objectClass(Person.class).enableReplication(true); new Defragment().Run("db.yap", delete);

  7. The db4o Replication System The db4o Replication System Version 5.1 of db4o introduced support for the db4o Replication System (dRS). dRS bridges the divide between db4o and relational databases. dRS also allows you to create replication applications for other databases. Support for working with relational databases within an object-oriented application is provided by Hibernate. Hibernate is a widely used open source object-relational mapping framework for Java, which uses XML configuration files to map objects onto database tables.

  8. Installing Installing dRS dRS dRS (www.db4o.com/community/ontheroad/downloadcenter/ free registration is required before you can access this site). The version described here is dRS 1.1. can be downloaded from the db4o Download Center The src folder contains the dRS sources. The doc directory contains the API and a useful tutorial. Finally, the lib directory contains all the libraries needed to run replication applications.

  9. dRS dRS Replication Between db4o Databases Replication Between db4o Databases Like db4o, dRS is an API rather than an application you can use it to create your own application to perform whatever replication process you require. You need to include the relevant dRS libraries in your project s classpath: dRS-core.jar and hibernate 3.jar are needed. All of the code shown can be placed in a single method to be executed. We need to configure db4o to generate UUIDs and version numbers for all objects: Db4o.configure().generateUUIDs(Integer.MAX_VALUE); Db4o.configure().generateVersionNumbers(Integer.MAX_VALUE);

  10. Next we open the two databases, and put a couple of objects (Person objects again) into each: new File("c:/local_db.yap").delete(); ObjectContainer handheld = Db4o.openFile("c:/local_db.yap"); handheld.set(new Person("Gandhi", 79)); handheld.set(new Person("Lincoln", 56)); new File("c:/remote_db.yap").delete(); ObjectContainer desktop = Db4o.openFile("c:/remote_db.yap"); some further code to list the contents of the databases to demonstrate that this replication has worked correctly.

  11. The output of this program is as follows, showing that the two Person objects have been replicated. The UUIDs and version numbers are retained when the objects are transferred between databases. Local:[Lincoln;56], UUID:[B@cdfc9c.1939274514499143370, version:1 Local:[Gandhi;79], UUID:[B@cdfc9c.1939274514499143369, version:1 Remote:[Gandhi;79], UUID:[B@cdfc9c.1939274514499143369, version:1 Remote:[Lincoln;56], UUID:[B@cdfc9c.1939274514499143370, version:1

  12. Replicating Back to the Original Database Replicating Back to the Original Database Add a few extra lines so that after the first replication some changes are made to the desktop database, and these are replicated back to the handheld database. Two new objects are added,and one is updated. desktop.set(new Person("Teresa", 87)); desktop.set(new Person("Mandela", 86)); Person update = (Person)desktop.get(new Person("Gandhi",0)).next(); update.setAge(80); desktop.set(update); desktop.commit(); ReplicationSession replication = Replication.begin(handheld, desktop, new ConflictResolver() { public Object resolveConflict(ReplicationSession session, Object a, Object b) { return a; } });

  13. ObjectSet changed2 = replication.providerB().objectsChangedSinceLastReplication(); while (changed2.hasNext()) replication.replicate(changed2.next()); replication.commit(); replication.close(); Output Local:[Mandela;86], UUID:[B@750159.-4752372636586212024, version:4 Local:[Teresa;87], UUID:[B@750159.-4752372636586212025, version:4 Local:[Lincoln;56], UUID:[B@1abab88.2455213756814525349, version:1 Local:[Gandhi;80], UUID:[B@1abab88.2455213756814525348, version:1 Remote:[Mandela;86], UUID:[B@750159.-4752372636586212024, version:4 Remote:[Teresa;87], UUID:[B@750159.-4752372636586212025, version:4 Remote:[Gandhi;80], UUID:[B@1abab88.2455213756814525348, version:4 Remote:[Lincoln;56], UUID:[B@1abab88.2455213756814525349, version:1

  14. Selective Replication Selective Replication you can apply any condition you like to select particular objects to be replicated. For example, let s change the initial (forward replication only) version of the previous example to replicate only Persons that have an even number value of age: while (changed.hasNext()) { Person p = (Person) changed.next(); if(p.getAge()%2 == 0) replication.replicate(p); } Output: The result will be that Gandhi, with age equal to 79, would not be replicated to the desktop: Local:[Lincoln;56], UUID:[B@cdfc9c.1939274514499143370, version:1 Local:[Gandhi;79], UUID:[B@cdfc9c.1939274514499143369, version:1 Remote:[Lincoln;56], UUID:[B@cdfc9c.1939274514499143370, version:1

  15. Thank you.

More Related Content