[ZT] full introduction to IBM Rational clearcase View

Source: Internet
Author: User

1. Introduction

Rational clearcaseAs a powerful Software Configuration Management (SCM) tool, it has been widely accepted by many enterprise users in China. To help you better understand and use clearcase, this article will comprehensively dissect an important part of clearcase: View ).

2. Classification of the clearcase View

We know that one of the basic functions of Software Configuration Management tools is to build and manage the developer's workspace. In clearcase, a workspace is called a view. It can select an appropriate version of each file or directory of the specified task and present it to the user. In general, view is like a filter. Based on a set of configuration rules, select the version of the file or directory we need from vob. View is a method to access files and directory versions in the vob database. Through views, users can browse, modify, and build available files and directories.

In actual use, views are divided into two types: Dynamic View (Dynamic View) and snapshot view (static view, also known as snapshot view ). Let's take a look at the differences between the two views:

Dynamic View:

• Automatic Synchronized updates with the vob database;

• Access the vob library transparently using the mvfs file system without occupying local space;

In the dynamic view, you do not need to copy files to a local directory and use the Virtual File System to access versions in vob.

• The use of dynamic views depends on the network;

• Provides shared derived objects and audit building functions, which are unique to dynamic views.

• The Dynamic View obtains data by mounting the specified vob database.

The dynamic view uses the Mount method to obtain the data in vob, which is a global view.

Static View:

• Files can only be updated on a regular basis through the update operation;

• Files are downloaded to the local device, occupying local space;

• It can work offline and be used out of the network;

• High-Speed compilation can be performed locally;

• Use static views to consume less resources on the clearcase server;

• The static view uses the vob library specified by load to view files.

Therefore, you can only download the copy of the file related to your needs (unless you need all the content), which can be achieved through special download rules. Of course, static views can also unload files filtered and deleted in the download rules.

By comparing the two views, we will find that they have their own merits. In actual use, when you want to work offline or only need part of the vob LibraryCodeWe recommend that you use a static view to reduce the pressure caused by frequent access to the server. If you are using a portable computer, it is more convenient to use a static view.

It is a good choice to create dynamic views quickly without occupying local space when you need to save local disk space, frequently update automatically, or simply view documents and code.

3. How to Create a view

After you install the clearcase client software, the first thing you need to do is to create a view. 1. Open the clearcase explorer. Taking base clearcase as an example, there is a "create View" in the toolbar ":

Figure 1

After clicking "create View", Figure 2 is displayed, because we use base clearcase as an example. Select default here.

Figure 2

Create a snapshot view or dynamic view based on your needs, as shown in Figure 3:

Figure 3

If you want to create a static view, 4, you need to specify the storage path of the view on the local machine (the files and directories that store the load from the vob library ).

Figure 4

If you want to create a dynamic view, you only need to specify a ing disc, as shown in Figure 5. Because the dynamic view accesses the data in the vob database through mvfs, you do not need to download the data to the local machine.

Figure 5

In Figure 4 and figure 5, there is an "advanced options" button. After you click it, see Figure 6. You can choose whether your view is stored on the server or on the local machine. Clearcase View data (mainly view database, etc.) can be stored in either the view server or the local machine. It is generally recommended to store it in view server for unified management of the Organization.

Figure 6

After the selection is complete, the page shown in 7 is displayed. Here there is an "inspect config spec" to define the configuration spec of this view. The configuration spec determines which versions can be seen, click to enter:

Figure 7

After entering "inspect config spec", we will find that there is a default specification in it, as shown in figure 8, which can be used directly. Generally, the administrator or Configuration Manager will write some specific configuration conventions for developers to use based on their development needs. Here, they will select and modify them.

Figure 8

After the above selection and settings are complete, a view can be created successfully.

4. View Management

A view usually corresponds to a task. After a period of use, you need to create multiple views, which involves view management and maintenance.

4. 1 Basic View-related operations

For common developers, view-related operations mainly include creating and deleting views, which is relatively simple. Note that you must use "Remove View" to delete a view, as shown in figure 9. If you use "Remove view shortcut cut", you only delete the shortcut of the view, which will appear again after the update.

An update operation exclusive to a static view needs to be performed on a regular basis before it can be synchronized with the data in vob.

Figure 9

4.2 about hijacked files

We know that after the static view downloads the files in vob to the local machine, the files are read-only. If you bypass the check-out operation and only remove the read-only attribute of a file to be changed, the file is called a hijacked file. Specifically, in clearcase explorer, an element in hijacked has a red circle with a pair.

If "hijacked" is displayed, you can select either of the following methods:

• Right-click the "hijacked" element and select "undo hijacked ". In order not to lose your changes to the file, after undo hijacked, clearcase automatically generates a private file with the suffix "keep" (view private files). In this case, you not only cancel hijacked, it also saves your work results (you can delete this private file if you do not need it ).

• Update view, right-click the "hijacked" element and select "check out". The element is in the "Checked Out" state, at this time, you can continue to modify this element, or directly perform the check in operation to complete the file change warehouse receiving, forming a new version.

The above also provides you with a static view of offline or home office methods, not bad.

4.3 migration of views

This part is mainly for the clearcase administrator. The migration of views is mainly to migrate the views in the view server from one storage area to another storage area on the same machine or to move across servers. When the view storage space is insufficient or a new server is used to improve the view server performance, views need to be migrated so that the original view information is not damaged and the client is basically unaffected, the original view can be used normally after migration.

The following example illustrates how to migrate a view from ccserv1 to ccserv2:

4.3.1 back up the view information of all users on ccserv1.

4.3.2 install ccserv2 as a view server and create a view storage path.

4.3.3 after completing the above preparations, you can perform formal migration.

• Stop the clearcase service on ccserv1, as shown in figure 10.

• Use the ccopy command to copy the ccserv1 view to the new view storage directory on ccserv2. for example:

Ccopy G: \ cc_storage \ views \ ccview \ ccserv2 \ CC _ storage \ views \ ccview

The above operation is to copy the view information in the ccview directory in ccserv1 to the ccview of ccserv2. if multiple directories need to be copied, you can write a script for unified operation.

Figure 10

4.3.4 check whether the data copied to ccserv2 is complete.

4.3.5 start the clearcase service on ccserv1 and re-register the migrated view on ccserv2.

Because hundreds of views may be involved, it is unrealistic to register a single view.Program. The basic idea is to delete the original registration information of the view and then re-register it to ccserv2. Here is an example written in Perl:

Printf ("all views begin registering: \ n ");

@ Lines = 'cleartool lsview-region soft1-s ';

Foreach $ line (@ lines)

{

Chomp ($ line );

$ View_info = 'cleartool lsview-region soft1 $ line ';

Chomp ($ view_info );

$ View_info = ~ M/(\ s +) \ s + (\ s + )/;

$ View_tag = $1;

$ View_stg = $2;

Printf "\ n ";

Printf ("the old view STG is: % s \ n", $ view_stg );

System ("cleartool rmtag-View-region soft1 $ view_tag ");

System ("cleartool unregister-view $ view_stg ");

$ New_view_stg = $ view_stg;

Chomp ($ new_view_stg );

If ($ new_view_stg = ~ M/ccview /)

{

$ New_view_stg = ~ S/\\\\ ccserv1 \ ccview \ views/\\\\ ccserv2 \ ccview \ views /;

}

Printf ("The new_view_stg is: % s \ n", $ new_view_stg );

$ Rc = system ("cleartool register-view $ new_view_stg ");

If ($ RC)

{

Print log_f "$ line \ n ";

}

System ("cleartool mktag-nstart-region soft1-View-tag $ view_tag $ new_view_stg ");

Printf "\ n ";

}

Printf ("all views register successfully! \ N ");

The above program deletes the original information of the View on ccserv1, and then registers it to ccserv2. Note that if multiple region instances exist, they must be processed separately.

4.3.6 verify that the migrated view is normal.

Check whether the original static and dynamic views can be used normally on the client. You can perform some common operations, such as checkout, checkin, update, and mount (only for dynamic views.

4.3.7 clear the View data and view storage path on ccserv1.

So far, the migration of the entire view has been completed.

4.4 clear view

Because the user does not properly handle the view, some junk views will appear after a period of operation (that is, they are no longer used but not completely cleared ), over time may seriously affect the performance of the clearcase server. You can run the following command to completely clear the file:

Cleartool rmtag-view $ tag;

Cleartool rmview-force-all-UUID $ UUID;

Cleartool unregist-View-UUID $ UUID;

The tag and UUID information required by the preceding commands can be obtained through the lsview command. These commands can be combined and written as a script to clear the garbage view in batches.

5. Summary

This article introduces the view in base clearcase in more detail (the UCM mode is based on activity, so it is different, which is not mentioned in this article). I hope it will be helpful to you. View itself involves a lot of content. If you have deeper requirements, you can refer to the user manual that comes with clearcase for further research.

Abbreviations:

Vob (versioned object base): A version object base and a clearcase data repository that stores all files, directories, and metadata under version control.

View: view, which can select the appropriate version of each file or directory of the specified task and present them.

View server: the server that stores View data.

Mvfs (multiversioned file system): A Multi-version file system that adds a new file system type by using standard operating system protocols. mvfs provides a transparent version control mechanism.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.